Only stop if the transition on this element ended
This way it doesn't end when some random element elsewhere on the page has an ending transition. It must be noted that this is not a complete fix. If you have multiple transitions on the element, it still ends when the first ends. I ran into this not working (the transition ends almost immediately, because some unrelated transition ends). This fixes it for me, but I was wondering whether this cornercase was considered, and whether the other cornercase (multiple transitions) was considered. I think it's very hard to get this correct, and think it might be better to make the timeout explicit, or at least allow to set it explicit, and fall back to this behaviour. But I'm really interested in feedback on this one.
Mark IJbema committed
Mar 25, 2014 at 15:02 UTC
89a21579149723c5db3a7f7472e33344e8584207
1 file changed
+3
src/addons/transitions/ReactCSSTransitionGroupChild.js
+3
@@ -55,6 +55,9 @@ var ReactCSSTransitionGroupChild = React.createClass({
55
var noEventTimeout = null;
56
57
var endListener = function() {
58
+ if (e.target !== node) {
59
+ return;
60
+ }
61
if (__DEV__) {
62
clearTimeout(noEventTimeout);
63
}