Skip to content
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] AnimatePresence & staggerChildren doesn't work when only some children are leaving and entering at the same time. #305

Closed
agonsalves opened this issue Aug 30, 2019 · 2 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@agonsalves
Copy link

1. Describe the bug
When you have AnimatePresence wrapped around a motion.div that has the staggerChildren transition, the initial rendering of the entire block works. However, if you remove some of the children, they do not use their exit animation. Then, when you add them back, they all come back at once.

2. Provide a CodeSandbox reproduction of the bug
https://codesandbox.io/embed/wonderful-dubinsky-75s3n

3. Steps to reproduce
Just use the toggle in the code sandbox

4. Expected behavior
I expect the exit animation to happen when the items unmount. I also expect that when the items are mounted again, they are staggered.

@agonsalves agonsalves added the bug Something isn't working label Aug 30, 2019
@msheakoski
Copy link

This was also brought up in #294. Linking here because you have a good Code Sandbox example.

@mattgperry
Copy link
Collaborator

AnimatePresence isn't going to work in this instance because its root child never leaves. This isn't a bug but improper use of the API.

When the children enter again, the parent isn't animating, so it can't stagger its children. This is a trickier one to solve and I don't see a fix on the horizon that would work as expected in all situations, I would recommend using a custom delay strategy here.

@mattgperry mattgperry added wontfix This will not be worked on and removed wip Do not merge labels Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants