aboutsummaryrefslogtreecommitdiff
path: root/js/src/dropdown.js
diff options
context:
space:
mode:
authorGeoSot <[email protected]>2022-01-30 23:50:22 +0200
committerXhmikosR <[email protected]>2022-02-01 08:58:46 +0200
commitd10543923531d9a2bf0e122439d5b1a2ae4e3d13 (patch)
tree474e5e169a9604695db69c9564923776cfc5505d /js/src/dropdown.js
parent22bbff0b037de5e4cf9a44273c4383a27b9f274e (diff)
downloadbootstrap-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/dropdown.js')
-rw-r--r--js/src/dropdown.js2
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) {