Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorGeoSot <geo.sotis@gmail.com>2022-01-31 00:50:22 +0300
committerXhmikosR <xhmikosr@gmail.com>2022-02-01 09:58:46 +0300
commitd10543923531d9a2bf0e122439d5b1a2ae4e3d13 (patch)
tree474e5e169a9604695db69c9564923776cfc5505d /js/src
parent22bbff0b037de5e4cf9a44273c4383a27b9f274e (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')
-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 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) {