-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[BUG] Animating already exiting elements causes them not to unmount #2673
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
1. Read the FAQs 👇
done
2. Describe the bug
Lets say we have a swap animation using AnimatePresence and it animates the swapping of 2 divs.
now when div a is entering and div b is exiting and I trigger the swapping again, it forgets to remove the now exiting div a.
or sometimes it works correctly but the next time triggering the animation both elements show up at the same time.
3. IMPORTANT: Provide a CodeSandbox reproduction of the bug
https://codesandbox.io/p/sandbox/framer-motion-bug-rmgdpz
4. Steps to reproduce
Click "change"
Then click it again while both elements are animating.
It all breaks
5. Expected behaviour
Simply exit and unmount the exited element
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working