-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Transition hangs if the transition is immediately cancelled #1116
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
Comments
Thanks. Unfortunately, this doesn't fix the issue if I use setTimeout, e.g.: http://jsfiddle.net/nkovacs/eaf85xfa/2/ On Chrome, with 10ms it never works, with 50 ms, it sometimes does. A more realistic test case: http://jsfiddle.net/nkovacs/5oz19aoz/ (keep clicking the link quickly) |
I did some testing with requestAnimationFrame. Setting justEntered to false on the next frame was not always enough on firefox, in fact, even nesting two requestAnimationFrames wasn't enough. And that's not with setTimeout, it's me clicking the menu items, including mouse movement from one menu item to the other, or using back/forward on my mouse. |
The real reason for this, is because you have the same styles for A simple but quite unintuitive fix is by giving |
Yeah, I know, I was hoping it would be possible to fix using requestAnimationFrame, but it looks like it's pretty much impossible to do. |
Fiddle: http://jsfiddle.net/nkovacs/eaf85xfa/
I think the transitionend event is not fired, since no transition happened.
Using a callback in enter and leave fixes it: http://jsfiddle.net/nkovacs/eaf85xfa/1/
But this has two problems:
The text was updated successfully, but these errors were encountered: