mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-22 06:39:52 +00:00
Dropdown: Clean more
This commit is contained in:
parent
21e5618ba7
commit
f71640f048
@ -399,8 +399,7 @@ class Dropdown extends BaseComponent {
|
|||||||
static dataApiKeydownHandler(event) {
|
static dataApiKeydownHandler(event) {
|
||||||
// If not input/textarea:
|
// If not input/textarea:
|
||||||
// - And not a key in UP | DOWN | ESCAPE => not a dropdown command
|
// - And not a key in UP | DOWN | ESCAPE => not a dropdown command
|
||||||
// If input/textarea:
|
// If input/textarea && If key is other than ESCAPE
|
||||||
// - If key is other than ESCAPE
|
|
||||||
// - If key is not UP or DOWN => not a dropdown command
|
// - If key is not UP or DOWN => not a dropdown command
|
||||||
// - If trigger inside the menu => not a dropdown command
|
// - If trigger inside the menu => not a dropdown command
|
||||||
|
|
||||||
@ -412,9 +411,9 @@ class Dropdown extends BaseComponent {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isInput) {
|
if (isInput && !isEscapeEvent) {
|
||||||
// eslint-disable-next-line unicorn/no-lonely-if
|
// eslint-disable-next-line unicorn/no-lonely-if
|
||||||
if (!isEscapeEvent && (!isUpOrDownEvent || event.target.closest(SELECTOR_MENU))) {
|
if (!isUpOrDownEvent || event.target.closest(SELECTOR_MENU)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user