-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
TransitionGroup leave animation doesn't get non-active style #847
Comments
Alright, I dug into the source today to see what was going on. This isn't a bug with TransitionGroup (all of the classes are being applied correctly) but a bug in the CSS. (In other words, my fault!) However, I do think it highlights a problem with the current animation approach. Let me back up a little to explain why: The reason that my fiddle doesn't work as I (incorrectly) expected is because the starting value of my In other words, it's not currently possible to specify a starting point for a leave animation that doesn't match the default value. Of course, I could set the One possible solution would be for React to add an idle class when the transition is idle. Alternatively, users could put the I realize that this behavior is all taken from ngAnimate, so maybe this isn't the best place to discuss the issue. On the other hand, the React project is much younger and there's probably more of an opportunity to correct it here without worrying about legacy. Let me know! |
I collected a few TransitionGroup issues here #587 . There are race conditions, for example repaints due to some other component's I guess I would not count on TransitionGroup but go for some custom solution, setting some visible/hidden props, tracking the states in some container, and triggering transitions based on comparing those props in components, notifying the container for completion.. Of course it will be a mess, but there are so many complicated interactions here... |
This isn't super actionable so I'm going to close it out. Thanks for your thoughts though! CSS transitions seem to be surprisingly tricky. |
I know this is close, but I thought I would also let people know that this problem snuck up on me to the point that I also dug through the source code only to find that I needed to move the |
I think I've come across a bug with TransitionGroup which basically causes properties of the "leave" styles to be ignored. Here's a fiddle demonstrating the problem.
As you can see, the "leave" animation doesn't use the correct origin or transition (in the latest Chrome or FF). If those properties are moved to an always-matching selector (".bluebox"), it works fine.
My only guess as to why this would happen is that the active leave class is being added in the same tick as the leave.
The text was updated successfully, but these errors were encountered: