You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] The animation breaks when quickly switching between tabs #2684
If I switch the tab to another one and quickly switch back to the previous one, then 'exit' does not run and all the contents inside the tab do not show up
Closing as fixed in the meantime. Your sandbox isn't reachable from here, so I rebuilt the "layout animations" tabs example it was forked from: a layoutId underline plus AnimatePresence mode="wait" around the tab content keyed by the selected tab. The Playwright test clicks Lettuce then Tomato 50ms apart and checks the Tomato content is shown at full opacity. On framer-motion 11.2.6 (your version) the content area is empty, matching your video. On current main the content shows correctly on React 18 and 19. If you still see this on the latest version, please reopen with a reproduction.
1. Describe the bug
If I switch the tab to another one and quickly switch back to the previous one, then 'exit' does not run and all the contents inside the tab do not show up
2. IMPORTANT: Provide a CodeSandbox reproduction of the bug
https://codesandbox.io/p/sandbox/framer-motion-layout-animations-forked-x772fv
3. Steps to reproduce
If you are on 'Tomato' tab, then click tab 'Lettuce' and then quickly click 'Tomato' tab again
5. Expected behavior
The animation must be completed correctly and the content must always be shown
6. Video or screenshots
2024-05-27.20-32-47.mp4
"framer-motion": "11.2.6",