-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[BUG] Animations do not resume after components resume after suspenseΒ #2269
Description
1. Read the FAQs π
β
2. Describe the bug
Animations that are interrupted with suspense have weird behaviour. Sometimes they will freeze in place. Sometimes they will freeze at the beginning. Sometimes they will complete.
3. IMPORTANT: Provide a CodeSandbox reproduction of the bug
I made a StackBlitz, hopefully that's OK: https://stackblitz.com/edit/vitejs-vite-uhm4h9?file=src%2FApp.tsx
4. Steps to reproduce
Steps to reproduce the behavior:
- Wait for the animation to show "suspended"
- Notice how the first animation is frozen in the wrong spot at the end
5. Expected behavior
For the animation to complete eventually once the suspended component re-mounts. Any one of these would be reasonable IMO:
- Proceed the animation by the amount of time the component has been suspended (so if it suspends at t=0.5 for 1 second, it resumes at t=1.5)
- Start the animation again
- Mount with the animation completed
There would be different behaviours for repeating animations and unmounting animations.
6. Video or screenshots
CleanShot.2023-08-01.at.14.25.16.png.mp4
7. Environment details
Chrome on macOS (M1)
Version 114.0.5735.198 (Official Build) (arm64)