Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(autocomplete): addresses bug with AngularJS 1.4.1
Browse files Browse the repository at this point in the history
Closes #3637
  • Loading branch information
Robert Messerle committed Jul 9, 2015
1 parent 3aab9e4 commit a52c943
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/autocomplete/js/autocompleteController.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,18 +242,18 @@ function MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $timeout, $
});
}

if (selectedItem !== previousSelectedItem) announceItemChange(selectedItem);
if (selectedItem !== previousSelectedItem) announceItemChange();
}

/**
* Use the user-defined expression to announce changes each time a new item is selected
*/
function announceItemChange( current ) {
angular.isFunction($scope.itemChange) && $scope.itemChange( getItemAsNameVal(current) );
function announceItemChange() {
angular.isFunction($scope.itemChange) && $scope.itemChange();
}

function announceTextChange( value ) {
angular.isFunction($scope.textChange) && $scope.textChange(value);
function announceTextChange() {
angular.isFunction($scope.textChange) && $scope.textChange();
}

/**
Expand Down Expand Up @@ -306,7 +306,7 @@ function MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $timeout, $
$scope.selectedItem = null;

// trigger change event if available
if ( searchText !== previousSearchText ) announceTextChange(searchText);
if ( searchText !== previousSearchText ) announceTextChange();

// cancel results if search text is not long enough
if (!isMinLengthMet()) {
Expand Down

0 comments on commit a52c943

Please sign in to comment.