-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Popover] Motion improvements #4580
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
Conversation
size-limit report
|
af7d85c to
805026a
Compare
|
🚢 |
chloerice
left a comment
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.
So good 🤌🏽
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.
This is great. Thanks @dfmcphee! I am only unsure about the will-change property and if it is actually needed for the transform and opacity. Happy to merge but would love a quick investigation to see if it is needed.
Don’t apply will-change to elements to perform premature optimization. If your page is performing well, don’t add the will-change property to elements just to wring out a little more speed. will-change is intended to be used as something of a last resort, in order to try to deal with existing performance problems. It should not be used to anticipate performance problems. Excessive use of will-change will result in excessive memory use and will cause more complex rendering to occur as the browser attempts to prepare for the possible change. This will lead to worse performance.
https://developer.mozilla.org/en-US/docs/Web/CSS/will-change
|
Great stuff @ouellettejordan and @dfmcphee! The asymmetric enter/exit patterns wasn't mentioned, i.e. removing exit transition. Perhaps not essential to the PR? A strong default and scalable pattern for sure!
|
Comparing with and without the
Good catch. I will update the description to reflect this too. |
|
Awesome! Turned out to be a lot simpler than I was thinking. |
|
@dfmcphee Thank you so much for this PR, this was very much needed, especially the scroll part |
WHY are these changes introduced?
This PR makes a few improvements to the
Popovercomponent including some foundational changes in things that it uses.WHAT is this pull request doing?
fastduration and an updatedbaseeasing curve woking with @johanstromqvist. It also removed the animation on close to make it get out of the users way immediately.Before
popover-motion-before.mov
After
popover-motion-after.mov
max-heightfor popovers to avoid forcing users to scroll the popover when they shouldn't need to.Before
After
Before
popover-scroll-before.mov
After
popover-scroll-after.mov
preferredPosition="above".Before
After
How to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
Copy-paste this code in
playground/Playground.tsx:🎩 checklist
README.mdwith documentation changes