diff options
author | GeoSot <geo.sotis@gmail.com> | 2022-01-31 00:50:22 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2022-02-01 09:58:46 +0300 |
commit | d10543923531d9a2bf0e122439d5b1a2ae4e3d13 (patch) | |
tree | 474e5e169a9604695db69c9564923776cfc5505d /js/src/dropdown.js | |
parent | 22bbff0b037de5e4cf9a44273c4383a27b9f274e (diff) |
Dropdown: merge instance identification in `dataApiKeydownHandler`
As we use the `dataApiKeydownHandler` only for events that are triggered on `[data-bs-toggle="dropdown"]` or on `.dropdown-menu`, we can ensure that their `parentNode` will ALWAYS be the `.dropdown` wrapper
Diffstat (limited to 'js/src/dropdown.js')
-rw-r--r-- | js/src/dropdown.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/js/src/dropdown.js b/js/src/dropdown.js index f636304095..779fe8f193 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -414,7 +414,7 @@ class Dropdown extends BaseComponent { return } - const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE)[0] + const getToggleButton = SelectorEngine.findOne(SELECTOR_DATA_TOGGLE, event.delegateTarget.parentNode) const instance = Dropdown.getOrCreateInstance(getToggleButton) if (isEscapeEvent) { |