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

fix(ngAnimate): run structural animations with cancelled out class ch… #14259

Closed
wants to merge 1 commit into from

Conversation

Narretz
Copy link
Contributor

@Narretz Narretz commented Mar 17, 2016

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Bugfix

Does this PR introduce a breaking change?
No

Please check if the PR fulfills these requirements

Other information:

…anges

When multiple animations on the same element are queued before a $digest passes,
the animator tries to create as few actual animations as possible by joining / canceling
redundant animations. Class-based animations for example are cancelled when the classes that
are added and removed are the same, and the result is no class-change. This however must only
happen if there's no structural animation currently queued.

Fixes #14249

@@ -1198,6 +1200,28 @@ describe("animations", function() {

expect(capturedAnimation[2].addClass).toBe('blue');
}));

it('should NOT cancel a previously joined addClass+structural animation if a follow-up removeClass animation is using the same class value (pre-digest)',
Copy link
Member

Choose a reason for hiding this comment

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

Too long ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Too small? ;)

@Narretz Narretz force-pushed the fix-animate-cancel-enter branch from 8176ff2 to a3fa069 Compare March 22, 2016 18:36
@Narretz
Copy link
Contributor Author

Narretz commented Mar 23, 2016

@gkalpak can you take another look at this?

@@ -1198,6 +1200,29 @@ describe("animations", function() {

expect(capturedAnimation[2].addClass).toBe('blue');
}));

it('should NOT cancel a previously joined addClass+structural animation if a follow-up' +
Copy link
Member

Choose a reason for hiding this comment

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

Missing whitespace after follow-up.

@gkalpak
Copy link
Member

gkalpak commented Mar 23, 2016

Other than the minor comments (whitespaces and unused var?), it LGTM 👍

…anges

When multiple animations on the same element are queued before a $digest passes,
the animator tries to create as few actual animations as possible by joining / canceling
redundant animations. Class-based animations for example are cancelled when the classes that
are added and removed are the same, and the result is no class-change. This however must only
happen if there's no structural animation currently queued.

Fixes angular#14249
@Narretz Narretz force-pushed the fix-animate-cancel-enter branch from a3fa069 to f3c0af7 Compare March 23, 2016 21:35
@Narretz
Copy link
Contributor Author

Narretz commented Mar 23, 2016

Landed as cc1de81 and c7813e9

@Narretz Narretz closed this Mar 23, 2016
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.

Bug: ngAnimation classes skipped on enter when using ng-if on form that contains required email input
4 participants