-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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 menu alignment fixes #32986
Conversation
This would restrict the user to use the the display static option only via data attributes. User can create the static dropdown via JavaScript as well. |
@rohit2sharma95 Gah, forgot about that. Any ideas for how we could do something programmatically in our JS to better handle this then? |
This is now stable fix IMO 🙂 |
515da80
to
e41c02c
Compare
@rohit2sharma95 can you add some tests please? Also, can you explain why we the last patch of yours? |
Because these data attributes are being added just for the styling of the dropdown menu, so instead of adding the attributes on the button element it would be good to add them on the dropdown menu directly. |
dc3a151
to
7408e4c
Compare
Since now there is a data attribute available to be sure about the usage of the Popper in the dropdown, the following code can be changed by using Lines 187 to 189 in 22d8e34
|
Awesome, if this looks good to y'all @XhmikosR and @rohit2sharma95, we can merge and then review #33003 and possibly merge that before Beta 2. Fine to wait until Beta 3 though if that's better! |
There's something missing for RTL, as you can see in this PR RTL Cheatsheet: not quite sure about what to do however. |
@ffoodd Do you mean we're missing an example in the RTL cheatsheet, or we're missing a bug? |
Popper cannot bear the |
Oh sorry @mdo, yeah it's buggy in RTL since dropdown menu it's not right aligned until playing around with devtools. |
Indeed, thanks @rohit2sharma95! 🚀 |
- Removes the &[style] selector that was used for resetting Popper styles - Separate Popper-based alignment from static alignment with `data-bs-popover` attribute that separates the --bs-position and custom right/left properties Co-Authored-By: Rohit Sharma <[email protected]>
Co-authored-by: Rohit Sharma <[email protected]>
03bf84b
to
c8807c3
Compare
This does a couple things in an attempt to resolve, at least temporarily, our dropdown menu alignment issues.
Removes the
&[style] { ... }
override @MartijnCuppens added. This alone resolves Dropdown menu not positioned correctly with .dropstart #32484, but this caused other issues with the menu alignment classes on static dropdowns.So, to fix that, now the menu alignment classes
.dropdown-menu-start
and.dropdown-menu-end
are positioned via Popper and use the--bs-position
CSS variable. I've removed theleft
andright
properties for those.And, in combination, I've scoped those
left
andright
properties to instances of the-start
and-end
classes that are used withdata-bs-display="static"
. It's not the best, but it resolves the alignment near as I can tell for all dropdown menus, static or otherwise.In the docs, I've added a temporary set of all the dropdown alignment options at the top of the page so I can quickly check things. I'll migrate this to the cheatsheet pages I think before merging, but didn't want to do that until getting some eyes on this.
Whatcha think—good enough for solving our woes ahead of Beta 2?
/cc @ffoodd @XhmikosR
TODO: