motion: [BUG] AnimatePresence gets stuck when state changes quickly
2. Describe the bug
Framer Motion v11.0.12: When state changes very quickly AnimatePresence gets stuck and out of sync and no longer removes the element but instead always animates it in. Reverting to version v10.12.2 (based of other bug report concerning a similar/same issue) does not exhibit the same problem
3. IMPORTANT: Provide a CodeSandbox reproduction of the bug https://codesandbox.io/p/sandbox/serene-brattain-qwd278
4. Steps to reproduce
- Conditionally render an element inside AnimatePresence with an exit animation
- Trigger condition change quickly
- Animating component gets stuck as rendered, and any changes to the condition will just trigger an reset from initial => animate. The component is no stuck as visible and will never leave the DOM.
5. Expected behavior
The component should not get stuck as mounted
6. Video or screenshots
If applicable, add a video or screenshots to help explain the bug.
7. Environment details
Chrome 122, Mac Sonoma
About this issue
- Original URL
- State: open
- Created 4 months ago
- Reactions: 20
- Comments: 30
This appears to have been broken in
11.0.11. Last version that doesn’t suffer from this issue is11.0.10.I have the same problem and still could not find the solution. It happened after version 11.0.8. Here is my example and code below.
https://github.com/framer/motion/assets/40694757/2d020827-8537-466c-a1eb-6bd3414be27f
@RareSecond This seems to solve the problem of “deleting” the object, but there’s still something wrong with it With opacity:
Without opacity:
I have the same issue. https://codesandbox.io/p/devbox/great-brattain-hc9kgz but i found using non-repeating
keycan solve it.10.12.2does not work for me,11.0.10doesFix it to 11.0.10
Correct. Just checked!