From 29e0c9dfa1c4324e4e2a8cf0b66e27b9e72f09a5 Mon Sep 17 00:00:00 2001 From: Rohit Sharma Date: Wed, 10 Feb 2021 00:34:23 +0530 Subject: =?UTF-8?q?Dropdown=20=E2=80=94=20Change=20the=20selector=20to=20c?= =?UTF-8?q?heck=20the=20use=20of=20Popper=20(#33003)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Create the popper instance first Make sure that popper instance has been created first and then apply the styling on the dropdown(menu) * Use `data-bs-popper` attibute to check popper Co-authored-by: XhmikosR --- js/src/dropdown.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/src') diff --git a/js/src/dropdown.js b/js/src/dropdown.js index 378668a6d..878a5a9a2 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -181,11 +181,11 @@ class Dropdown extends BaseComponent { const popperConfig = this._getPopperConfig() const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false) + this._popper = Popper.createPopper(referenceElement, this._menu, popperConfig) + if (isDisplayStatic) { Manipulator.setDataAttribute(this._menu, 'popper', 'static') } - - this._popper = Popper.createPopper(referenceElement, this._menu, popperConfig) } // If this is a touch-enabled device we add extra -- cgit v1.2.3