aboutsummaryrefslogtreecommitdiff
path: root/js/src/dom/selector-engine.js
diff options
context:
space:
mode:
authorMartijn Cuppens <[email protected]>2020-02-01 14:56:20 +0100
committerMartijn Cuppens <[email protected]>2020-03-23 15:35:07 +0100
commit2e150e722a946f20ded62b39abe28f244f6ae050 (patch)
treeb8e23908d7a08583f56367aa5190f68747dd345e /js/src/dom/selector-engine.js
parent85b12549ecff83f866588394ecff747e69567bc4 (diff)
downloadbootstrap-2e150e722a946f20ded62b39abe28f244f6ae050.tar.xz
bootstrap-2e150e722a946f20ded62b39abe28f244f6ae050.zip
Use next dropdown menu instead of first of the parent
Diffstat (limited to 'js/src/dom/selector-engine.js')
-rw-r--r--js/src/dom/selector-engine.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/js/src/dom/selector-engine.js b/js/src/dom/selector-engine.js
index a8c14ae4c..c18ec4136 100644
--- a/js/src/dom/selector-engine.js
+++ b/js/src/dom/selector-engine.js
@@ -67,6 +67,20 @@ const SelectorEngine = {
}
return []
+ },
+
+ next(element, selector) {
+ let next = element.nextElementSibling
+
+ while (next) {
+ if (this.matches(next, selector)) {
+ return [next]
+ }
+
+ next = next.nextElementSibling
+ }
+
+ return []
}
}