From 1556e82f8d9a1a7f38f30dbb6c035a4cebdc1f48 Mon Sep 17 00:00:00 2001 From: Joshua Gdovin Date: Thu, 18 Aug 2016 14:04:37 -0400 Subject: [PATCH 1/2] fix for issue #6174 --- src/typeahead/typeahead.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/typeahead/typeahead.js b/src/typeahead/typeahead.js index 126fd1fd47..24ad4e8d91 100644 --- a/src/typeahead/typeahead.js +++ b/src/typeahead/typeahead.js @@ -470,7 +470,8 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap // Issue #3973 // Firefox treats right click as a click on document if (element[0] !== evt.target && evt.which !== 3 && scope.matches.length !== 0) { - resetMatches(); + isNoResultsSetter(originalScope, false); + resetMatches(); if (!$rootScope.$$phase) { originalScope.$digest(); } From 50134c71b76bff2046c3fba9debed7bd63904f22 Mon Sep 17 00:00:00 2001 From: Joshua Gdovin Date: Thu, 18 Aug 2016 15:04:05 -0400 Subject: [PATCH 2/2] empty results never make it into the if statement, no need to ignore empty results here --- src/typeahead/typeahead.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/typeahead/typeahead.js b/src/typeahead/typeahead.js index 24ad4e8d91..5c3eaedbd5 100644 --- a/src/typeahead/typeahead.js +++ b/src/typeahead/typeahead.js @@ -469,7 +469,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', '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 && scope.matches.length !== 0) { + if (element[0] !== evt.target && evt.which !== 3) { isNoResultsSetter(originalScope, false); resetMatches(); if (!$rootScope.$$phase) {