From 4dab96e28c3ac920e16d1f8573b29dcddfc4cf50 Mon Sep 17 00:00:00 2001 From: Foxandxss <foxandxss@gmail.com> Date: Fri, 13 Nov 2015 16:49:12 +0100 Subject: [PATCH] refactor(dropdown): remove regex to not match 138 and 140 Closes #4892 --- src/dropdown/dropdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dropdown/dropdown.js b/src/dropdown/dropdown.js index def60d197c..46816826bb 100644 --- a/src/dropdown/dropdown.js +++ b/src/dropdown/dropdown.js @@ -58,7 +58,7 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position']) if (evt.which === 27) { openScope.focusToggleElement(); closeDropdown(); - } else if (openScope.isKeynavEnabled() && /(38|40)/.test(evt.which) && openScope.isOpen) { + } else if (openScope.isKeynavEnabled() && [38, 40].indexOf(evt.which) !== -1 && openScope.isOpen) { evt.preventDefault(); evt.stopPropagation(); openScope.focusDropdownEntry(evt.which);