Skip to content
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

fix: enusre sheet is animated correctly with new framer motion #2407

Conversation

loodde
Copy link
Contributor

@loodde loodde commented Mar 28, 2024

With the framer-motion 11.0.18 update the sheet opening animation stopped working. This commit fixes that by moving the motion animation to wrap the dialog content and overlay. The sheet exit animation has been broken prior to the 11.0.18 patch and this commit also fixes that by conditionally rendering the dialog root with isOpen, as is described in the framer motion docs.

Kudos to @Hadlabergman for debugging!

@loodde loodde requested a review from a team as a code owner March 28, 2024 13:56
@loodde loodde requested a review from filiptammergard March 28, 2024 13:56
Copy link
Member

@filiptammergard filiptammergard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work @loodde and @Hadlabergman! ⭐

A properly working exit animation really makes it so much smoother as well!

Let's just rebase this on #2408 before merging, to make sure checks are passing and also to make sure a new version is released when merging.

@filiptammergard
Copy link
Member

commitlint is complaining a little bit. Wanna fix that @loodde?

Copy link
Contributor

github-actions bot commented Mar 28, 2024

@filiptammergard filiptammergard force-pushed the fix/correctly-animate-sheet-open-close-with-latest-framer-motion branch from 0f21208 to c916466 Compare March 28, 2024 14:57
loodde and others added 2 commits March 28, 2024 15:57
With the framer-motion 11.0.18 update the sheet opening animation stopped working.
This commit fixes that by moving the motion animation to wrap
the dialog content and overlay.
The sheet exit animation has been broken prior to the 11.0.18 patch and this commit
also fixes that by conditionally rendering the dialog root with isOpen,
as is described in the framer motion docs.
@filiptammergard filiptammergard force-pushed the fix/correctly-animate-sheet-open-close-with-latest-framer-motion branch from c916466 to 3dff286 Compare March 28, 2024 14:57
@filiptammergard
Copy link
Member

I took the opportunity to fix the failing test and to also fix the commitlint issue. FYI @loodde

@filiptammergard
Copy link
Member

Feel free to merge when you're ready @loodde. I'm off now, back in November 😅👶

@loodde loodde merged commit d0bcf4d into master Apr 2, 2024
7 checks passed
@loodde loodde deleted the fix/correctly-animate-sheet-open-close-with-latest-framer-motion branch April 2, 2024 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants