Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <markdotto@gmail.com>2017-10-28 22:04:47 +0300
committerMark Otto <markdotto@gmail.com>2017-10-28 22:04:47 +0300
commitbc53cb8bc53e858aee8665c8ed676147e768c244 (patch)
treedb727998f38513724755bc64c469c739755cea78 /js/dist/dropdown.js
parent380c920f1c32681fdd0f3375b2ea3e1739fdd6a9 (diff)
dist
Diffstat (limited to 'js/dist/dropdown.js')
-rw-r--r--js/dist/dropdown.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/js/dist/dropdown.js b/js/dist/dropdown.js
index d42daa4e82..acc919ff90 100644
--- a/js/dist/dropdown.js
+++ b/js/dist/dropdown.js
@@ -340,7 +340,14 @@ var Dropdown = function ($) {
};
Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
- if (!REGEXP_KEYDOWN.test(event.which) || /button/i.test(event.target.tagName) && event.which === SPACE_KEYCODE || /input|textarea/i.test(event.target.tagName)) {
+ // If not input/textarea:
+ // - And not a key in REGEXP_KEYDOWN => not a dropdown command
+ // If input/textarea:
+ // - If space key => not a dropdown command
+ // - If key is other than escape
+ // - If key is not up or down => not a dropdown command
+ // - If trigger inside the menu => not a dropdown command
+ if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
return;
}