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

1.2.0rc1 - Animation system does not work when you have both ngHide and ngClass #3784

Closed
ryanzec opened this issue Aug 28, 2013 · 3 comments · Fixed by #4573
Closed

1.2.0rc1 - Animation system does not work when you have both ngHide and ngClass #3784

ryanzec opened this issue Aug 28, 2013 · 3 comments · Fixed by #4573
Assignees

Comments

@ryanzec
Copy link

ryanzec commented Aug 28, 2013

With the new animation system, if you have ngHide and ngClass on the same element, animations stop working (it might happen with other combinations too). Look at this plunker:

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

This is a plunker from the yearofmoo article on the animation system in 1.2.0. All I did was add a ngClass directive on this and the animations no longer play. This is happening in 1.2.0rc1 and I also tested it against the code the include the patch for this issue : #3587 : and both of them show the issue. If you remove the ngClass directive on the element, the animation works fine.

@ryanzec
Copy link
Author

ryanzec commented Aug 30, 2013

Can anyone confirm this is a bug that will be fixed before 1.2.0 stable is released?

@matsko
Copy link
Contributor

matsko commented Aug 30, 2013

ngShow and ngHide work the same way as ngClass in 1.2 -- they both add and remove the ng-hide class. And when ngAnimate detects an animation on the same element where another animation is ongoing then it cancels the first animation in favour of the next animation. What's going on here is that ngShow/ngHide gets triggered and starts to do it's animation work, but then ngClass gets evaluated and tells animator to add the active class which cancels out the show/hide animation.

This is expected behaviour, but I can see how it should work different. Ideally ngClass should only animate and cancel out an ongoing animation if it's CSS class styling has a transition/animation property present on it. I'll look into doing this.

@ghost ghost assigned matsko Oct 1, 2013
@matsko
Copy link
Contributor

matsko commented Oct 1, 2013

I've assigned this to post 1.2 just so it doesn't interfere with rc3. However, I'll be working on it this week.

matsko added a commit to matsko/angular.js that referenced this issue Oct 22, 2013
…ass contains CSS transition/keyframe animation code

Closes angular#4463
Closes angular#3784
@matsko matsko closed this as completed in f5289fe Oct 23, 2013
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
…ass contains CSS transition/keyframe animation code

Closes angular#4463
Closes angular#3784
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
…ass contains CSS transition/keyframe animation code

Closes angular#4463
Closes angular#3784
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.