Repository navigation
Description
I'm submitting a ...
[x] bug report
Current behavior
Follow up to #16919
Using the latest master builds, with PR #16937 merged, some animation end styles are now too persistent. i.e. they stay even after setting a new state or the wrong style is persisted.
Last working version was 4.2.0-beta.1. (PR #16937 addressed reported issues in #16919 of 4.2.0-rc.0, but this issue slipped through)
Expected behavior
Expect the last style in the transition([]) to be persisted if outside of a parallel group(). Also, if a state change occurs 'in-flight' of another animation, I expect the new state styles (and or animation) to be applied.
Minimal reproduction of the problem with instructions
Repro: https://plnkr.co/edit/fWaBeI?p=preview (uses master builds)
I expect the opacity to be 1 after the animation finishes. i.e. the 'normal' state
The group() end styles are overriding the last animate(style()) in the plunker above. i.e. it seems to be ignoring the order
trigger('transAnim', [
state('normal', style({ transform: 'translate3d(0px, 0px,0)', opacity: '1' })),
state('intrans', style({ transform: 'translate3d(90px, 0px,0)', opacity: '0' })),
transition('normal => intrans',
[
style({ opacity: '1' }),
group([
animate('1000ms 200ms', keyframes([
style({ transform: 'translate3d(0px, 0px,0)', offset: 0.25 }),
style({ color: '#ffffff', offset: 0.7 }),
style({ transform: 'translate3d(90px, 0px,0)', offset: 1 }),
])),
animate('500ms 1100ms ease-in-out', style({ opacity: '0' }))
]),
style({ transform: 'translate3d(0px, 0px,0)' }),
animate('500ms 50ms ease-in-out', style({ opacity: '1' })),
])
])Also, changing the state back to 'normal' before the 'intrans' animation is complete, I'd still expect it to apply the 'normal' styles.
What is the motivation / use case for changing the behavior?
Fix animation end styling. Behave as it did in v4.2.0-beta.1
You can set the plunker ng version in systemjs.config.js back to 4.2.0-beta.1 to see the desired behaviour.
Don't forget to set ngNightly = false;
var ngVer = '4.2.0-beta.1';
var ngNightly = false; // set false to use ngVer
Please tell us about your environment:
Windows 7, code, yarn, ng-cli
- Angular version: 4.2.0-rc.0 and latest angular/*-builds
- Browser: Tested in Chrome Desktop, and iOS Safari / WKWebView
-
Language: Typescript 2.3.2
-
Node (for AoT issues):
node --version=
/cc @matsko
Activity
dharders commentedon May 23, 2017
Experimenting with the plunker, I noticed another difference in behavior between 4.2.0.beta.1 and rc.0 which may or may not explain this bug.
**beta 1 order of animations/styles: **
style({ opacity: '1' })then
group([...])then
style({ transform: 'translate3d(0px, 0px,0)' })then
animate('500ms 50ms ease-in-out', style({ opacity: '1' }))**rc 0 order of animations/styles: **
style({ opacity: '1' })andstyle({ transform: 'translate3d(0px, 0px,0)' })then
group([...])then
animate('500ms 50ms ease-in-out', style({ opacity: '1' }))I discovered this by applying a
backgroundColorstyle within thegroup()and outside in the second laststyle()i.e.
The above works in beta.1 but fails to build with rc.0 with the error:
I assume this is a bug, but my mental model of animation order might be incorrect too. Can you please confirm @matsko ? Since it worked in previous versions, I assume the previous way was correct.
[-]Animations: end state style sometimes incorrect [/-][+]Animations: end state style regression[/+]fix(animations): always change to desired animation state even if no …
dharders commentedon Jun 5, 2017
Found a regression with mid-flight animation state changes.
Created issue #17170
fix(animations): always change to desired animation state even if no …
fix(animations): always change to desired animation state even if no …
angular-automatic-lock-bot commentedon Sep 11, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.