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

ngAnimate: Wrong classes attached to element with animations #4699

Closed
mik01aj opened this issue Oct 29, 2013 · 8 comments
Closed

ngAnimate: Wrong classes attached to element with animations #4699

mik01aj opened this issue Oct 29, 2013 · 8 comments

Comments

@mik01aj
Copy link

mik01aj commented Oct 29, 2013

I got an element with ng-class="{shown: !!some.condition}", initially shown, and I noticed that it has weird classes attached. I set up a breakpoint to watch changes of this element, and here's how the class list changed:

  1. thumbnails ng-isolate-scope ng-scope shown
  2. thumbnails ng-isolate-scope ng-scope shown shown-add-active (attached stackrace is from here)
  3. then some time passes... ($timeout)
  4. thumbnails ng-isolate-scope ng-scope shown shown-add-active ng-animate
  5. thumbnails ng-isolate-scope ng-scope shown shown-add-active ng-animate shown-remove
  6. thumbnails ng-isolate-scope ng-scope shown shown-add-active ng-animate shown-remove shown-remove-active
  7. thumbnails ng-isolate-scope ng-scope shown shown-add-active ng-animate shown-remove-active
  8. thumbnails ng-isolate-scope ng-scope shown shown-add-active ng-animate
  9. thumbnails ng-isolate-scope ng-scope shown shown-add-active
  10. thumbnails ng-isolate-scope ng-scope shown-add-active
  11. ...and it stays stuck in this position.

One interesting thing I noted was also that the last change (10) was done by jqLite, not jQuery (which we use in our project).

Here's also a stacktrace from step 2:
screen shot 2013-10-29 at 15 27 24

I use the newest angular (d434eabec3 from master).

@matsko
Copy link
Contributor

matsko commented Oct 29, 2013

I fixed an issue relative to this yesterday. Could you perhaps try using the latest snapshot and see if this problem presists? http://code.angularjs.org/snapshot/

@mgol
Copy link
Member

mgol commented Oct 29, 2013

@matsko As @mik01aj stated, we're using Angular from commit d434eab which is the newest commit on the master branch.

@olostan
Copy link
Contributor

olostan commented Oct 30, 2013

I had issue that looked like that.

The reason what in not quite strictly ordered CSS. Check weight of your css's selectors - keep in mind that "xxx-add" should have less weight of 'xxx-add-active'.

I don't know is it a problem or it is supposed to be in this way, but it least if worked for me.

@matsko
Copy link
Contributor

matsko commented Oct 30, 2013

I noticed this same bug yesterday in app that I was writing. I'm checking the fix right now and I'll have a new branch that you guys can test it out on.

@matsko
Copy link
Contributor

matsko commented Oct 30, 2013

Please try the code in this commit: matsko@f018810

@ghost ghost assigned mhevery and matsko Oct 30, 2013
matsko added a commit to matsko/angular.js that referenced this issue Oct 31, 2013
@mik01aj
Copy link
Author

mik01aj commented Nov 1, 2013

@matsko: Yes, this fixed the bug, thank you! However we are still experiencing other strange behaviours with ngAnimate classes staying forever on an element. But I think it's a topic for another issue.

@matsko matsko mentioned this issue Nov 2, 2013
@matsko
Copy link
Contributor

matsko commented Nov 4, 2013

@mik01aj can you provide some more info is possible?

@matsko
Copy link
Contributor

matsko commented Nov 5, 2013

@mik01aj can you please email me. I need your assistance testing a patch for ngAnimate.

IgorMinar pushed a commit to IgorMinar/angular.js that referenced this issue Nov 6, 2013
matsko added a commit to matsko/angular.js that referenced this issue Nov 6, 2013
@matsko matsko closed this as completed in e53ff43 Nov 6, 2013
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 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

5 participants