-
Notifications
You must be signed in to change notification settings - Fork 27.4k
fix($animate): ensure that parallel class-based animations are all eventually closed #7767
Conversation
Mary Poppins needs to take a vacation. |
@matsko - the code and test look good but on the plunker there is a weird slight delay between the loading message disappearing and the actual button disappearing. I don't see why that should be happening. Any thoughts? |
I'm seeing the delay as well. My expectation would be that since both |
The delay is there since the ngShow animation commences just after the $timeout is done. The ngShow animation sets the space for the transition since it is applied globally to all animations that share the |
@matsko are you saying that the transition I have in the |
@danxshap this works as expected. ngAnimate is not smart enough to deduce a transition that will take place based on the Notice how cancelling out the transition for |
…entually closed When multiple classes are added/removed in parallel then $animate only closes off the last animation when the fallback timer has expired. Now all animations are closed off. Fixes angular#7766
Ugh, some Github issue and my comment showed up twice, so I deleted 1 and now they're both gone! Rewriting... @matsko I'll admit I don't have an intimate understanding of the ngAnimate source (e.g. how From my perspective as an Angular user: I have a button which I've put a CSS transition on so that the background color changes smoothly on hover. Now I simply want to hide the button with Angular. As you showed in your example, now I'll also have to remember to set the My 2 cents. |
Yes this is one of those unfortunate side-effects of relying too much on CSS. But sadly getComputedStyle is all we have and there is no way to detect to see if a transition actually kicked off or not without doing a deep copy of every style on getComputedStyle. I've been searching for an answer for quite some time: |
It would be cool if I could put a class on my element like |
There's a provider flag called |
Nice, thanks for the tip! If you're not using |
Very nice. Also (finally) this pull request came out to green. Merging this in now. |
Merged. Landed as f07af61 |
Thank you @danxshap for all the help on finding this bug. |
Anytime! |
When multiple classes are added/removed in parallel then $animate only closes off the
last animation when the fallback timer has expired. Now all animations are closed off.
Fixes #7766