-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Transition group classes not being properly deleted when using v-show #5800
Comments
I don't think we're dealing with Vue issue here. Chrome/Firefox are throttling timers in inactive tabs to simply reduce ram/cpu usage, so you can't rely on setTimeout running every x second as you want it to. A solution for your problem is rather simple, pause the animation when user leaves to another tab, and then restart it when he comes back Fixed example - https://jsfiddle.net/605wqn3k/1/ |
Makes sense. Thanks a lot for the quick response :) But I still gotta ask, is there anything against checking if transition classes already exsist when the change occurs regarldess of whether transitionend/animationend was fired or not? |
@yunyu Could you please check this issue ? Is it related with your situation? |
@jkzing Actually, yeah, it seems to affect me as well. Any transitions I put in the enter-active class don't work at all, and only the ones in enter-to do. Should I move my example to that issue? |
@yunyu, thanks, but there is already a quite clear reproduce in that issue.😁 |
I was going to create a new issue, but found this one. My bug is different, but it seems that it might help to solve current issue, because I've created a very simple situation how to reproduce this transition bug. Reproduction link: Steps to reproduce:
What is expected? (and it works like this if not switching browser tabs)
What is actually happening? |
@alexbazilev I think your case is a different situation, created a separate issue for you: #7411 NVM, your are in the situation #5800 (comment) is saying, sorry for the spam...😂 |
Any update on this ? I'd love a workaround ✌️ |
Version
2.3.3
Reproduction link
https://jsfiddle.net/ma7moudat/u82ugj8z/1/
Steps to reproduce
Set up a transition group that automatically rotates through a list of items and shows one item at a time (a slider if you will).
What is expected?
The last item disappears and the new item appears at the specified intervals.
What is actually happening?
Everything seems to be running perfectly fine, but if you leave the window for a minute or so (go to a new tab or another window) and then come back, the transition group becomes a mess, because the transition classes get added over and over without being removed from the items.
So you would get something like this!
<div class="item crossfade-enter-to crossfade-enter-to crossfade-leave-to crossfade-enter-to crossfade-leave-to crossfade-enter-to crossfade-leave-to crossfade-enter-to crossfade-leave-to crossfade-enter-to crossfade-leave-to crossfade-enter-to crossfade-leave-to crossfade-enter-to crossfade-leave-to crossfade-enter-to crossfade-leave-to .........">
The text was updated successfully, but these errors were encountered: