From 85846922934226d2d62646df06d96f644e332378 Mon Sep 17 00:00:00 2001 From: Robert Messerle Date: Fri, 1 May 2015 09:04:16 -0700 Subject: [PATCH] fix(autocomplete): addresses issue where dropdown shows if there is an initial value Closes #2517 --- src/components/autocomplete/js/autocompleteController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/autocomplete/js/autocompleteController.js b/src/components/autocomplete/js/autocompleteController.js index 00eef09e055..36f5bde1f60 100644 --- a/src/components/autocomplete/js/autocompleteController.js +++ b/src/components/autocomplete/js/autocompleteController.js @@ -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;