-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Popover: check positioning by adding and testing is-positioned class #46429
Conversation
Size Change: +15 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
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.
I like the change 👍 Given that we have various different ways to position a popover, and various reasons to check if a popover has been positioned, this is going to be very handy.
🚀
As a follow-up, we could also take animation state into account and set |
When a
Popover
component is finished positioning, i.e., when theuseFloating
hook from thefloating-ui
library returns validx
andy
coordinates, add ais-positioned
CSS class on the popover element.This is then used by the
.toBePositionedPopover
helper to detect a positioned popover. We don't need to check the exact styles, which are an implementation detail that can change. Like it does in #46187.Closes #46303.