-
Notifications
You must be signed in to change notification settings - Fork 47.1k
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
CSSTransitionGroup does not animate if child calls getBoundingClientRect() on componentDidMount #3672
Comments
I'm also seeing this while using https://github.com/akiran/react-slick The width is zero during componentDidMount. I'm using react 0.13.3. This is the line that is returning zero
|
The problem in my case was that I had hidden the parent container with display:none and was attempting to fade it in, but display: none makes the widths zero. I'm trying a different approach. |
I’m going to close since we don’t plan any more changes to TransitionGroup in React repo. Instead, it now is maintained by the community, and you can file an issue in the new repository if this is still affecting you. Thanks! |
Possibly not a React bug, but I haven't been able to reproduce in vanilla JS/HTML/CSS so far.
Demo: http://jsfiddle.net/cjqg0y48/1/
I encountered this when I tried to fade in a component that contains react-swipe which uses a plain JS library under the hood. It seems like the call it makes to getBoundingClientRect() magically neutralizes the transition, causing it to have no effect.
One workaround seems to be deferring the getBoundingClientRect() call using setTimeout. (Thanks GreenJello on #reactjs)
The text was updated successfully, but these errors were encountered: