-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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] Fix paper position flash on open #34546
Conversation
Thanks for your work. Your fix seems to work. I'm going to test it more thoroughly. BTW, the affected components, such as Select will be implemented using MUI Base in the future, which doesn't suffer from this issue AFAIK. This way the implementation will be simpler. |
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.
Everything seems to be in order! Thanks again for your contribution.
Issues
Changes
Previously popovers could have been rendered before they were positioned, resulting in them briefly appearing in the top-left corner particularly on slower devices and with low
transitionDuration
. This PR hides the popover paper until positioning is complete.Drawbacks
On slower devices, the opening animation may be completely skipped since the animation would complete before positioning would finish. This can be demonstrated with the Chrome dev tools' CPU throttling feature. Due to the current way that popover is designed, there is a sort of catch-22 in which the the paper only mounts once the transition begins, but positioning can only occur after the paper mounts. Changing other parts of the code to get around that issue is certainly possible, but I have not attempted to do that in this PR.
Resolves #33308