-
Notifications
You must be signed in to change notification settings - Fork 793
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
[BUG] State updates still interrupting layout animations #1085
Comments
Update: while debugging I found out that this only happens when the element that is animating out (the modal in my example) does not have an |
What actually happens is on the state update of the child that is being exited, the transition switches to that of the following child. In this example you see the transition actually becoming slower instead of faster: https://codesandbox.io/s/framer-motion-state-update-during-layout-transition-issue-9eh9p?file=/src/Test.tsx |
Fixed in Screen.Recording.2021-08-30.at.11.56.35.movEdit: still happens on rc.1: https://codesandbox.io/s/framer-motion-state-update-during-layout-transition-issue-on-v5-0-0-rc-1-kqf50?file=/package.json |
Here's another issue: https://codesandbox.io/s/framer-motion-v5-5-0-layout-animation-reset-on-state-update-76l4n Screen.Recording.2021-09-06.at.14.38.58.movNote that the lead element is reset to its starting position on a React state update. |
On Screen.Recording.2021-10-23.at.18.31.34.mov |
Here is a more minimal reproduction without Portal: https://codesandbox.io/s/framer-motion-v5-0-0-layout-transition-funkiness-lbfff?file=/src/App.tsx To see the working as intended behaviour, comment out the Also the original issue still happens on rc.1: https://codesandbox.io/s/framer-motion-state-update-during-layout-transition-issue-on-v5-0-0-rc-1-kqf50?file=/package.json |
I stumbled upon a similar problem, here's another (a little bit smaller) reproduction that may be relevant - https://codesandbox.io/s/framer-rerender-issue-1cmcf 5.3.3 - the non-memoized version of the component is very jittery Screen.Recording.2021-11-25.at.23.22.50.mov |
It's also preferable to add |
Describe the bug
This was reported in #732 and fixed in #1018 (v3.10.1), but it seems there still is an issue.
CodeSandbox reproduction of the bug
https://codesandbox.io/s/9eh9p?file=/src/Modal.tsx
Steps to reproduce
Steps to reproduce the behavior:
Screen.Recording.2021-04-02.at.10.48.02.mov
Expected behavior
Comment out the
useEffect
inModal.tsx
to see the expected behaviour:Screen.Recording.2021-04-02.at.10.47.17.mov
The text was updated successfully, but these errors were encountered: