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

Commit

Permalink
fix(typeahead): only reset matches if matches are present
Browse files Browse the repository at this point in the history
- Resets matches only when matches are present to avoid extra $digest

Closes #3119
  • Loading branch information
mwinkels authored and wesleycho committed Aug 1, 2015
1 parent ab4580f commit 97e077e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/typeahead/typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
var dismissClickHandler = function (evt) {
// Issue #3973
// Firefox treats right click as a click on document
if (element[0] !== evt.target && evt.which !== 3) {
if (element[0] !== evt.target && evt.which !== 3 && scope.matches.length !== 0) {
resetMatches();
if (!$rootScope.$$phase) {
scope.$digest();
Expand Down

0 comments on commit 97e077e

Please sign in to comment.