New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular animation: :enter & :leave have non-symmetric behavior #29509
Comments
We have exactly the same issue and we tracked the issue to We think it's here because it's the only change related to animations in version 7.2.8. May it be something related to frames of the animation, where the animation is only doing one frame rather than all of them, thus seeming that there is no :leave animation? We have pinned our angular animations version to 7.2.7 until a fix is released... |
Hi @mfursov the issue with your stackblitz is that you put the trigger in the The asymmetry is caused by the fact that the trigger is places in the wrong element, this causes the two different behavors, let me explain:
This makes total sense, because as I just said the I hope this helps 馃檪 |
Thanks @dario-piotrowicz, for your clarifications here. @mfursov, I'm going to close this as behaving as intended, but we can definitely re-open if you feel this answer isn't clear enough / there's still a problem other than the open issue for documentation. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Affected Package
@angular/animations
Description
:enter animation works, while :leave does not for child components of *ngFor
I believe that the behavior should be symmetric.
馃敩 Minimal Reproduction
https://stackblitz.com/edit/angular-qcqfdk?file=src%2Fapp%2Fapp.component.ts
馃實 Your Environment
Chrome 73
Angular Version:
7.2.5
Anything else relevant?
There is a workaround to make :leave animation to work by adding
trigger('animateChild', [ transition(':enter, :leave', [query('@*', animateChild())]) ]),
trigger either to *ngFor or to a child component.
or by moving animation trigger from the child component to the *ngFor element.
The text was updated successfully, but these errors were encountered: