-
Notifications
You must be signed in to change notification settings - Fork 27.5k
ngAnimate/ngRepeat issue with duplicates and transitional classes #4490
Comments
Can you provide your CSS animation code? It might be that the transition style is placed in the wrong area causing the animation to last forever. |
the only animation-related code for those particular elements is: div {
opacity: 1;
transition: opacity .2s;
} when dark stripe is open (stripe is animated) div {
opacity: 0;
} when it's hidden |
So the problem here is that you're placing your transition code on the DIV element. Please place all transition code on the So in your case: div.ng-leave {
opacity: 1;
transition: opacity .2s;
} And div.ng-leave.ng-leave-active {
opacity: 0;
} ngAnimate may hang if the transition is placed elsewhere. |
@matsko The problem is those animations were not meant to be parsed by ngAnimate. We can have many such things in the app just because in many cases ngAnimate is not needed to create working transitions. However, ngAnimate seems to intervene in all situations where there's a transition present which creates such problems. In other words, it seems that just including the ngAnimate dependency in the app that has transitions working correctly can break the application. This makes it much harder to seamlessly & gradually integrate the module into the codebase. Couldn't the code be changed so that ngAnimate ignores an element if its classes don't have ngAnimate-like classes styled with transitions? |
it works, thanks a lot! I leave it to you to decide if there's an issue or not and close this one. |
@mzgol it does that already though. If you have any animation code on the element at the time of the animation (and that animation code is not defined inside of the |
@matsko I don't have an answer for you right away. I'll check for it tomorrow, when I have more time. |
@jrencz no rush :) |
@jrencz any progress on this? |
@matsko I'm sad to admit but none. I wrote your solution works, but it's not: I just didn't remove a patch hiding elements with ng-leave-active class. |
@matsko I found a solution in animate. |
Very nice! |
In some cases ngAnimate transitional classes (like *-remove & *-remove-active) were left after animation was over. Change introduced in this commit prevent such situations. Closes angular#4490
@matsko I pushed it a little too soon and it breaks tests. Im on that |
@matsko It's sad to admin but my change just disabled some of animate functionalities, which I dod not notice untill run tests, instead of fixing this one. |
I think if it should be mentioned in docs that not setting transition on |
@jrencz have you been setting an animation on the |
I did use As I mentioned before I patched this bug - wherever it is: in my app or in animate - with |
Here's what I think is going on. Somewhere in your CSS code you have an enter/leave even that has display:none set to the style and this makes the transition styles never complete which makes it hang. This causes there to be double the amount of elements (100% of the items entering + 100% of the old items leaving). Animating the Can you post all of your CSS code surrounding these elements caught in the blocking animation? |
@matsko Check your e-mail. :) |
…class is missing Closes angular#4732 Closes angular#4490
…class is missing Closes angular#4732 Closes angular#4490
…class is missing Closes angular#4732 Closes angular#4490
…class is missing Closes angular#4732 Closes angular#4490
…s dangling DOM nodes after ng-repeat finishes. angular/angular.js#4490
…s dangling DOM nodes after ng-repeat finishes. angular/angular.js#4490
I'm aware this issue can be somewhat project-related when it comes to styles, but anyway I find it strange enough to address an issue here.
Please take a look at this screenshot:
http://img43.imageshack.us/img43/3544/lwaj.png
on this screenshot you'll find an issue with duplicated elements in ngRepeat.
There are 3 elements in collection passed to ngRepeat.
As you can see 3 original elements are on top, but there 3 duplicates with ng-animate ng-leave and ng-leave-active classes as well.
With ngAnimate disabled it does not occur
The text was updated successfully, but these errors were encountered: