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

Commit

Permalink
fix(typeahead): remove popup flickering
Browse files Browse the repository at this point in the history
Closes #1011
  • Loading branch information
pkozlowski-opensource committed Sep 19, 2013
1 parent 157f614 commit dde804b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/typeahead/test/typeahead.spec.js
Expand Up @@ -127,6 +127,9 @@ describe('typeahead tests', function () {
var element = prepareInputEl("<div><input ng-model='result' typeahead='item for item in source | filter:$viewValue'></div>");
changeInputValueTo(element, 'ba');
expect(element).toBeOpenWithActive(2, 0);

changeInputValueTo(element, '');
expect(element).toBeClosed();
});

it('should not open typeahead if input value smaller than a defined threshold', function () {
Expand Down
3 changes: 2 additions & 1 deletion src/typeahead/typeahead.js
Expand Up @@ -145,7 +145,6 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
//$parsers kick-in on all the changes coming from the view as well as manually triggered by $setViewValue
modelCtrl.$parsers.unshift(function (inputValue) {

resetMatches();
if (inputValue && inputValue.length >= minSearch) {
if (waitTime > 0) {
if (timeoutPromise) {
Expand All @@ -157,6 +156,8 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
} else {
getMatchesAsync(inputValue);
}
} else {
resetMatches();
}

if (isEditable) {
Expand Down

0 comments on commit dde804b

Please sign in to comment.