From 2e150e722a946f20ded62b39abe28f244f6ae050 Mon Sep 17 00:00:00 2001 From: Martijn Cuppens Date: Sat, 1 Feb 2020 14:56:20 +0100 Subject: Use next dropdown menu instead of first of the parent --- js/src/dom/selector-engine.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'js/src/dom') diff --git a/js/src/dom/selector-engine.js b/js/src/dom/selector-engine.js index a8c14ae4c8..c18ec4136f 100644 --- a/js/src/dom/selector-engine.js +++ b/js/src/dom/selector-engine.js @@ -66,6 +66,20 @@ const SelectorEngine = { previous = previous.previousElementSibling } + return [] + }, + + next(element, selector) { + let next = element.nextElementSibling + + while (next) { + if (this.matches(next, selector)) { + return [next] + } + + next = next.nextElementSibling + } + return [] } } -- cgit v1.2.3