angular: Animations: animateChild() not working correctly
I’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
This bug war not present in Angular 4.2.0-rc.1. But it appears with any newer version. Test setup contains two components. The parent component is created and destroyed by *ngIf. The inner child component has an angular animation assigned to it. If the components are created, the inner one plays its animation -> OK. If the outer component is destroyed it disappears before the inner component can finish it’s animation, so you can’t see the childs fade out animation -> NOK. AnimateChild() on the outer component should make this work but it doesn’t.
Expected behavior
Finished animation of child component before destroying of the parent component.
Minimal reproduction of the problem with instructions
https://plnkr.co/edit/E3srjH?p=preview
What is the motivation / use case for changing the behavior?
Environment
Angular version: 4.2.0 and newer
Browser:
- [x] Chrome (desktop) version 59
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [x] Firefox version 54
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX
- Platform: Windows
Others:
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 9
- Comments: 20 (8 by maintainers)
Commits related to this issue
- fix(animations): ensure animateChild() works with all inner leave animations Closes #18305 — committed to matsko/angular by matsko 7 years ago
- fix(animations): ensure animateChild() works with all inner leave animations Closes #18305 — committed to matsko/angular by matsko 7 years ago
- fix(animations): ensure animateChild() works with all inner leave animations (#19006) Closes #18305 PR Close #19006 — committed to matsko/angular by matsko 7 years ago
- fix(animations): ensure animateChild() works with all inner leave animations (#19006) Closes #18305 PR Close #19006 — committed to matsko/angular by matsko 7 years ago
- fix(animations): ensure animateChild() works with all inner leave animations Closes #18305 — committed to matsko/angular by matsko 7 years ago
- fix(animations): ensure animateChild() works with all inner leave animations (#19006) Closes #18305 PR Close #19006 — committed to matsko/angular by matsko 7 years ago
- fix(animations): ensure animateChild() works with all inner leave animations (#19006) Closes #18305 PR Close #19006 — committed to matsko/angular by matsko 7 years ago
- fix(animations): ensure animateChild() works with all inner leave animations (#19006) Closes #18305 — committed to matsko/angular by matsko 7 years ago
- fix(animations): ensure animateChild() works with all inner leave animations Closes #18305 — committed to matsko/angular by matsko 7 years ago
- fix(animations): ensure animateChild() works with all inner leave animations (#19532) Closes #18305 PR Close #19532 — committed to chuckjaz/angular by matsko 7 years ago
- fix(animations): ensure animateChild() works with all inner leave animations Closes #18305 — committed to matsko/angular by matsko 7 years ago
- fix(animations): ensure animateChild() works with all inner leave animations Closes #18305 — committed to matsko/angular by matsko 7 years ago
- fix(animations): ensure animateChild() works with all inner leave animations (#19006) Closes #18305 — committed to matsko/angular by matsko 7 years ago
- fix(animations): ensure animateChild() works with all inner leave animations (#19006) (#19532) Closes #18305 PR Close #19532 — committed to chuckjaz/angular by matsko 7 years ago
Sorry to keep pestering you @matsko , but any update on the reverted PR ?
Alright it’s finally working: https://plnkr.co/edit/7u3iPFGNjD8vLAZAnx54?p=preview
@dharders I really appreciate you sticking to this issue and providing feedback. Sorry it’s taking so long to fix, it’s a bit tricky since it keeps making internal tests fail.
Things right now are passing again, once it’s back in master I will investigate your plnkr and get to the bottom of this.
This issue isn’t fixed yet @chuckjaz so I think it needs to be reopened. Here’s an updated plunker 5.0.0-rc.1 and the issue remains. Within the plunker you can also run off master
system.config.ts
and setngNightly = true;
, but you’ll see the issue still remains also. (this may be due to PR revert).Any thoughts @matsko ?
It didn’t last long, the commits have just been reverted yet again 😭
@matsko @chuckjaz Is there any public notice available for why reverts, in general, are being made? I would appreciate if reverts are communicated in their originating PR, probably also reopening the PR itself would help keeping track of what is going on. In any case, thanks a lot for your effort!
Thanks @matsko awesome work as always!
This PR fixes the issue: https://github.com/angular/angular/pull/19006
It will be merged next week!
Once https://github.com/angular/angular/pull/18853 lands then I can fix this.
Thank you @MichaelPolster for reporting the issue and @dharders for providing me another plnkr. I am looking into this now.