diff options
| author | GeoSot <[email protected]> | 2021-10-10 16:47:02 +0300 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2021-12-01 17:10:39 +0200 |
| commit | f71640f04844f921613efee90b4868871f96f701 (patch) | |
| tree | ea429cf88abd2a71a7c3eb44261cbcb8df0f943f /js | |
| parent | 21e5618ba7007aa11b8a7751f1bbc1a9465dbab1 (diff) | |
| download | bootstrap-f71640f04844f921613efee90b4868871f96f701.tar.xz bootstrap-f71640f04844f921613efee90b4868871f96f701.zip | |
Dropdown: Clean more
Diffstat (limited to 'js')
| -rw-r--r-- | js/src/dropdown.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/js/src/dropdown.js b/js/src/dropdown.js index d5dfe2e20..510fcf1a4 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -399,8 +399,7 @@ class Dropdown extends BaseComponent { static dataApiKeydownHandler(event) { // If not input/textarea: // - And not a key in UP | DOWN | ESCAPE => not a dropdown command - // If input/textarea: - // - If key is other than ESCAPE + // If input/textarea && 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 @@ -412,9 +411,9 @@ class Dropdown extends BaseComponent { return } - if (isInput) { + if (isInput && !isEscapeEvent) { // eslint-disable-next-line unicorn/no-lonely-if - if (!isEscapeEvent && (!isUpOrDownEvent || event.target.closest(SELECTOR_MENU))) { + if (!isUpOrDownEvent || event.target.closest(SELECTOR_MENU)) { return } } |
