-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
Reset styles when popper is calculating position #32510
Conversation
230a745
to
28ca7cb
Compare
I'm not sure why but the behaviour changed in RTL,
I can't see the relation with this PR though, but noticed it. Might be unrelated. |
this._popper = Popper.createPopper(referenceElement, this._menu, this._getPopperConfig()) | ||
this._menu.classList.remove(CLASS_NAME_POPPER_ACTIVE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we remove the class again? When the element if positioned by popper the right
property will not have an effect anyway or am I wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I would expect too, but it turns out this is needed by popper.
As per the comment written in the code here: Lines 36 to 40 in 122b2bd
This right style was added to reset the position when the dropdown is positioned with Popper. (This was not in V4 where Popper V1 is used) As per my research, if you remove the right style from the dropdown, it works fine (even when Popper is not used): https://bootstrap-1jtqi8bem.vercel.app/docs/5.0/components/dropdowns/ Or maybe I am missing something @twbs/css-review 🙂 Edit: Noticed that initially |
I tried to get rid of all the |
Popper does not require the elements to have positioning styles and it can not place elements correctly that have positioning styles already.
|
Is this supposed to fix the |
Because of the positioning of the dropdown initially. |
d0de138
to
c4b6c48
Compare
@rohit2sharma95 the issue mdo described above still happens. Was this supposed to be fixed by #32524? |
#32524 was just to remove the margin from the dropdown. The wrong placement of |
Opened #32986 as an alternative for now. |
Closing for #32986. |
Farewell style hack 👋
Fixes #32484
https://deploy-preview-32510--twbs-bootstrap.netlify.app/docs/5.0/components/dropdowns/#dropleft