diff options
| author | GeoSot <[email protected]> | 2022-01-30 23:50:22 +0200 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2022-02-01 08:58:46 +0200 |
| commit | d10543923531d9a2bf0e122439d5b1a2ae4e3d13 (patch) | |
| tree | 474e5e169a9604695db69c9564923776cfc5505d /js/src | |
| parent | 22bbff0b037de5e4cf9a44273c4383a27b9f274e (diff) | |
| download | bootstrap-d10543923531d9a2bf0e122439d5b1a2ae4e3d13.tar.xz bootstrap-d10543923531d9a2bf0e122439d5b1a2ae4e3d13.zip | |
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')
| -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 f63630409..779fe8f19 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) { |
