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);