1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-08 06:36:33 +02:00

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 <xhmikosr@gmail.com>
This commit is contained in:
Rohit Sharma
2021-02-10 00:34:23 +05:30
committed by GitHub
parent 91d3da1f3d
commit 29e0c9dfa1
2 changed files with 6 additions and 9 deletions

View File

@@ -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