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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using multiple "[@triggerName]" on single element stops removal of node after ":leave" animation completes #20541
Comments
That's the bug I was looking for. Is there any workaround ? |
So the bug here is not that there are two triggers, but when one or more the triggers does not include a I'm working on a fix right now. |
…ve animations finish Closes angular#20541
This fix will take care of it: #20740 |
@matsko thanks ! You rock ! |
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. |
I'm submitting a...
Current behavior
When using multiple
[@triggerName]
attributes on a single element, then when'* => void'
or:leave
completes, the node that was about to be removed from the DOM is not removed.Okay:
Not okay (but fine in Angular 4.4.6):
Expected behavior
The node which removal triggered the animation, should be removed after the animation completes.
Note: this assumes that defining multiple
[@triggerName]
attributes is actually supported.Using multiple
[@triggerName]
attributes worked in Angular 4.4.6, but it seems it was not actually documented. In Angular 5, this no longer works. The extensive example at https://angular.io/guide/animations#example-entering-and-leaving-from-different-states might indicate that one should use at most one[@triggerName]
, in which case the bug report is moot and the documentation might simply be clarified instead.Minimal reproduction of the problem with instructions
See https://plnkr.co/edit/DQRDKpv6srJEsHbHd315?p=preview
Make sure the rightmost "Enter & Leave" column is visible.
Add some heroes.
Remove the heroes.
See that in the "Enter & Leave" column the animations work great, but when completed the heroes have not been removed (and hence re-appear after the animations complete):
This Plunker is based on https://github.com/angular/angular/blob/5.0.2/aio/content/examples/animations/src/app/hero-list-enter-leave.component.ts:
Changed the single
[@flyInOut]
into[@flyIn]
and[@flyOut]
:Separated the single
flyInOut
trigger into two triggers:Same when using
:enter
and:leave
.What is the motivation / use case for changing the behavior?
For some elements we only apply
[@flyOut]
, for others both[@flyIn]
and[@flyOut]
. An easy workaround is to just define more specific triggers (which we do now).As this worked fine in Angular 4.4.6, this might have been introduced by:
Environment
The text was updated successfully, but these errors were encountered: