* 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>
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
&[data-bs-popper] {
left: 0;
+ margin-top: $dropdown-spacer;
}
}
top: auto;
bottom: 100%;
- &.show:not([data-popper-placement]) {
+ &[data-bs-popper] {
margin-top: 0;
margin-bottom: $dropdown-spacer;
}
right: auto;
left: 100%;
- &.show:not([data-popper-placement]) {
+ &[data-bs-popper] {
margin-top: 0;
margin-left: $dropdown-spacer;
}
right: 100%;
left: auto;
- &.show:not([data-popper-placement]) {
+ &[data-bs-popper] {
margin-top: 0;
margin-right: $dropdown-spacer;
}
.dropdown-menu.show {
display: block;
-
- &:not([data-popper-placement]) {
- margin-top: $dropdown-spacer;
- }
}
// Dropdown section headers