diff options
| author | Rohit Sharma <[email protected]> | 2021-02-10 00:34:23 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-02-09 21:04:23 +0200 |
| commit | 29e0c9dfa1c4324e4e2a8cf0b66e27b9e72f09a5 (patch) | |
| tree | dd1d4cf3ea6fd81a51089919c45c230db6fe6c09 /js/src | |
| parent | 91d3da1f3dca3127d50b81928c01d4bd63054269 (diff) | |
| download | bootstrap-29e0c9dfa1c4324e4e2a8cf0b66e27b9e72f09a5.tar.xz bootstrap-29e0c9dfa1c4324e4e2a8cf0b66e27b9e72f09a5.zip | |
Dropdown — Change the selector to check the use of Popper (#33003)
* 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 <[email protected]>
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/dropdown.js | 4 |
1 files changed, 2 insertions, 2 deletions
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 |
