Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit dde804b

Browse files
committedSep 19, 2013
fix(typeahead): remove popup flickering
Closes #1011
1 parent 157f614 commit dde804b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
 

‎src/typeahead/test/typeahead.spec.js

+3
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ describe('typeahead tests', function () {
127127
var element = prepareInputEl("<div><input ng-model='result' typeahead='item for item in source | filter:$viewValue'></div>");
128128
changeInputValueTo(element, 'ba');
129129
expect(element).toBeOpenWithActive(2, 0);
130+
131+
changeInputValueTo(element, '');
132+
expect(element).toBeClosed();
130133
});
131134

132135
it('should not open typeahead if input value smaller than a defined threshold', function () {

‎src/typeahead/typeahead.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
145145
//$parsers kick-in on all the changes coming from the view as well as manually triggered by $setViewValue
146146
modelCtrl.$parsers.unshift(function (inputValue) {
147147

148-
resetMatches();
149148
if (inputValue && inputValue.length >= minSearch) {
150149
if (waitTime > 0) {
151150
if (timeoutPromise) {
@@ -157,6 +156,8 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
157156
} else {
158157
getMatchesAsync(inputValue);
159158
}
159+
} else {
160+
resetMatches();
160161
}
161162

162163
if (isEditable) {

0 commit comments

Comments
 (0)