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

fix(ngAnimate): properly cancel-out previously running class-based animations #13814

Closed
wants to merge 1 commit into from

Conversation

matsko
Copy link
Contributor

@matsko matsko commented Jan 21, 2016

Prior to this fix the addition and removal of a CSS class via
ngAnimate would cause flicker effects because $animate was unable
to keep track of the CSS classes once they were applied to the
element. This fix ensures that ngAnimate always keeps a reference
to the classes in the currently running animation so that cancelling
works accordingly.

Closes #10156
Closes #13814

Please merge for 1.4 and 1.5.

@Narretz
Copy link
Contributor

Narretz commented Jan 21, 2016

Unfortunately, I'm not seeing that the issue is fixed: http://plnkr.co/edit/HIaO54UfXl9z674KSzZV?p=preview

Steps to repdroduce - just being verbose, to make sure we see the same thing.

  1. You are initially on link 1 (green)
  2. Click on link 2
  3. Immediately click on link 1

What should we see?
The orange show animation should be briefly visible, then it should be hidden immediately (no animation / transition style on the hide animtion) and the green box should fade in.

What do we see?
The orange box doesn't hide immediately. It lingers around for a split second before disappearing.

The whole thing doesn't happen when you switch the link slowly.
So I wonder if it's something else instead.

…imations

Prior to this fix the addition and removal of a CSS class via
ngAnimate would cause flicker effects because $animate was unable
to keep track of the CSS classes once they were applied to the
element. This fix ensures that ngAnimate always keeps a reference
to the classes in the currently running animation so that cancelling
works accordingly.

Closes angular#10156
Closes angular#13814
@matsko matsko force-pushed the pr_10156 branch 2 times, most recently from f7181cc to 9a2fbdc Compare January 21, 2016 21:33
@matsko
Copy link
Contributor Author

matsko commented Jan 21, 2016

@Narretz try this demo: http://plnkr.co/edit/GwDlruHuZs4ZKFP7kqC9?p=preview. I think your animate.js might have not been the right build.

@Narretz
Copy link
Contributor

Narretz commented Jan 21, 2016

@matsko Oh, do I look stupid now! I've only built the unminified version, but tested it with the minified, which was older of course. Let's just pretend this didn't happen, okay? 😉

@matsko
Copy link
Contributor Author

matsko commented Jan 21, 2016

@Narretz I won't tell anyone :P

@vitaly-t
Copy link

Great! Will it get into 1.3?

@Narretz
Copy link
Contributor

Narretz commented Jan 22, 2016

We don't backport to 1.3 anymore. And I think the bug was introduced in 1.4
anyway. Why are you still on 1.3?
Am 22.01.2016 02:36 schrieb "Vitaly Tomilov" [email protected]:

Great! Will it get into 1.3?


Reply to this email directly or view it on GitHub
#13814 (comment).

@Narretz
Copy link
Contributor

Narretz commented Jan 22, 2016

@vitaly-t Okay, I see it has been reported first for 1.3, but we don't support 1.3 - only for major breaking stuff.

Narretz pushed a commit to Narretz/angular.js that referenced this pull request Jan 22, 2016
…imations

Prior to this fix the addition and removal of a CSS class via
ngAnimate would cause flicker effects because $animate was unable
to keep track of the CSS classes once they were applied to the
element. This fix ensures that ngAnimate always keeps a reference
to the classes in the currently running animation so that cancelling
works accordingly.

Closes angular#10156
Closes angular#13814
@@ -374,7 +379,7 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
close();
return runner;
} else {
mergeAnimationOptions(element, existingAnimation.options, options);
mergeAnimationDetails(element, existingAnimation.options, options);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come we don't need to pass the animation object, but the options (considering all other invocation changed) ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flickering with ngAnimate and ngShow
6 participants