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

Commit

Permalink
fix(typeahead): change to original scope
Browse files Browse the repository at this point in the history
- Change to original scope for running $digest

Closes #5588
Fixes #5467
  • Loading branch information
wesleycho committed Mar 5, 2016
1 parent dd62c73 commit 7949494
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/typeahead/typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap
evt.stopPropagation();

resetMatches();
scope.$parent.$digest();
originalScope.$digest();
break;
case 38:
scope.activeIdx = (scope.activeIdx > 0 ? scope.activeIdx : scope.matches.length) - 1;
Expand Down Expand Up @@ -455,7 +455,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap
if (element[0] !== evt.target && evt.which !== 3 && scope.matches.length !== 0) {
resetMatches();
if (!$rootScope.$$phase) {
scope.$digest();
originalScope.$digest();
}
}
};
Expand Down

0 comments on commit 7949494

Please sign in to comment.