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

Commit 97e077e

Browse files
mwinkelswesleycho
authored andcommitted
fix(typeahead): only reset matches if matches are present
- Resets matches only when matches are present to avoid extra $digest Closes #3119
1 parent ab4580f commit 97e077e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/typeahead/typeahead.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
404404
var dismissClickHandler = function (evt) {
405405
// Issue #3973
406406
// Firefox treats right click as a click on document
407-
if (element[0] !== evt.target && evt.which !== 3) {
407+
if (element[0] !== evt.target && evt.which !== 3 && scope.matches.length !== 0) {
408408
resetMatches();
409409
if (!$rootScope.$$phase) {
410410
scope.$digest();

0 commit comments

Comments
 (0)