Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ng-class animation is broken when using with ng-repeat and orderBy filter #7872

Closed
vbilici opened this issue Jun 17, 2014 · 4 comments
Closed

Comments

@vbilici
Copy link

vbilici commented Jun 17, 2014

Hello,
when using ng-class animations with ng-repeat directive and also using with orderBy Filter ng-repeat animation overrides the ng-class animation. (className-add never works and className-remove sometimes works). Is this a bug or a normal behaviour?

Here is the plunker:
http://plnkr.co/edit/29ORioZgazFwSvKn95ks?p=preview

Angular version: 1.2.18 (also tested with latest 1.3 and result is the same)

Thank you

@Narretz Narretz self-assigned this Jun 20, 2014
@Narretz Narretz added this to the 1.3.0 milestone Jun 20, 2014
@Narretz
Copy link
Contributor

Narretz commented Jun 20, 2014

Strange indeed. maybe @matsko knows more

@Narretz Narretz removed their assignment Jun 20, 2014
@matsko matsko self-assigned this Jun 21, 2014
@matsko
Copy link
Contributor

matsko commented Jun 21, 2014

I will have a look later today.

matsko pushed a commit to matsko/angular.js that referenced this issue Jun 23, 2014
@matsko
Copy link
Contributor

matsko commented Jul 1, 2014

Yes, this is the normal behaviour since the structural animation takes precedence over the class-based animation. First the move happens, then it waits a digest and ngClass changes (which causes an animation for a microsecond), then the move animation happens. Despite there being no animation setup for the move event (when orderBy does its thing), ngAnimate still thinks there is one since the .row-anim class has a transition property on it.

Unfortunetly there is no easy way to get around this on the same element. You could use ng-animate-children (brand new feature in 1.3) and place ng-class animations on the TD elements:

http://plnkr.co/edit/Q9BBlJzDI5yTWBDbqANw?p=preview

@matsko
Copy link
Contributor

matsko commented Jul 1, 2014

There's nothing that can be done directly without causing a bunch of breaking changes. So this will close for now.

@matsko matsko closed this as completed Jul 1, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants