Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown — Change the selector to check the use of Popper #33003

Merged
merged 3 commits into from Feb 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/src/dropdown.js
Expand Up @@ -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')
}

XhmikosR marked this conversation as resolved.
Show resolved Hide resolved
this._popper = Popper.createPopper(referenceElement, this._menu, popperConfig)
}

// If this is a touch-enabled device we add extra
Expand Down
11 changes: 4 additions & 7 deletions scss/_dropdown.scss
Expand Up @@ -34,6 +34,7 @@

&[data-bs-popper] {
left: 0;
margin-top: $dropdown-spacer;
}
}

Expand Down Expand Up @@ -73,7 +74,7 @@
top: auto;
bottom: 100%;

&.show:not([data-popper-placement]) {
&[data-bs-popper] {
margin-top: 0;
margin-bottom: $dropdown-spacer;
}
Expand All @@ -90,7 +91,7 @@
right: auto;
left: 100%;

&.show:not([data-popper-placement]) {
&[data-bs-popper] {
margin-top: 0;
margin-left: $dropdown-spacer;
}
Expand All @@ -110,7 +111,7 @@
right: 100%;
left: auto;

&.show:not([data-popper-placement]) {
&[data-bs-popper] {
margin-top: 0;
margin-right: $dropdown-spacer;
}
Expand Down Expand Up @@ -187,10 +188,6 @@

.dropdown-menu.show {
display: block;

&:not([data-popper-placement]) {
margin-top: $dropdown-spacer;
}
}

// Dropdown section headers
Expand Down