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 issue where dropdown shows if there is a…
Browse files Browse the repository at this point in the history
…n initial value

Closes #2517
  • Loading branch information
Robert Messerle committed May 1, 2015
1 parent 2fef6ca commit 8584692
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/autocomplete/js/autocompleteController.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ function MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $timeout, $

function handleSearchText (searchText, previousSearchText) {
self.index = getDefaultIndex();
//-- do nothing on init if there is no initial value
if (!searchText && searchText === previousSearchText) return;
//-- do nothing on init
if (searchText === previousSearchText) return;
//-- clear selected item if search text no longer matches it
if (searchText !== getDisplayValue($scope.selectedItem)) $scope.selectedItem = null;
else return;
Expand Down

0 comments on commit 8584692

Please sign in to comment.