From 0237658e5de15396a73c1049f260899baad09162 Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Mon, 20 Jul 2015 06:33:19 -0700 Subject: [PATCH] fix(typeahead): don't close popup on right click - Ensure typeahead popup does not dismiss on right click in Firefox --- src/typeahead/typeahead.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/typeahead/typeahead.js b/src/typeahead/typeahead.js index 0a63f63247..9988ba76de 100644 --- a/src/typeahead/typeahead.js +++ b/src/typeahead/typeahead.js @@ -377,7 +377,9 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap // Keep reference to click handler to unbind it. var dismissClickHandler = function (evt) { - if (element[0] !== evt.target) { + // Issue #3973 + // Firefox treats right click as a click on document + if (element[0] !== evt.target && evt.which !== 3) { resetMatches(); if (!$rootScope.$$phase) { scope.$digest();