diff --git a/js/src/dropdown.js b/js/src/dropdown.js index 6129707e26..06f69af7be 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -132,7 +132,7 @@ class Dropdown extends BaseComponent { return } - const parent = Dropdown.getParentFromElement(this._element) + const parent = getElementFromSelector(this._element) || this._element.parentNode // Totally disable Popper for Dropdowns in Navbar if (this._inNavbar) { Manipulator.setDataAttribute(this._menu, 'popper', 'none') @@ -408,10 +408,6 @@ class Dropdown extends BaseComponent { } } - static getParentFromElement(element) { - return getElementFromSelector(element) || element.parentNode - } - static dataApiKeydownHandler(event) { // If not input/textarea: // - And not a key in REGEXP_KEYDOWN => not a dropdown command