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
Parent ngIf not respecting child's animation to finish before parent is removed from DOM #23302
Comments
Examplehere is an example demonstrating the problem: A child Versionsthe issue occurs with angular 6.1.9 and 7.0.0-beta.7 WorkaroundAdd a dummy-animation to the parent element with the trigger('blub', [
transition('* => void', [
query("@*", [animateChild()], {optional: true})
]),
]) <div *ngIf="showing" [@blub]>
<div [@bla] style="background: blue; width: 200px; height: 50px"></div>
</div> @matsko if I remember correctly there have been several issues with nested animations. However, here it is not a nested animation, but an animation triggered by a parent's |
Just bumped into this, is there any workaround? |
* fix(select): Fixes width-issue of select option panel in IE11 Fixes the select options panel width not matching the select width in IE11 Fixes #11609 * code cleanup * fix leave-animation of select panel not working due to angular/angular#23302
* fix(select): Fixes width-issue of select option panel in IE11 Fixes the select options panel width not matching the select width in IE11 Fixes #11609 * code cleanup * fix leave-animation of select panel not working due to angular/angular#23302
I am also having the same issue.
|
Any news on this? |
I met the issue too,any solution? |
@jasonaden @matsko Is it possible to get someone assigned to this so we could liaise with them? I'm not sure how to take this further. |
There's a work around that can make it work. It consists of creating a "dumb" animation to place on the tag with
and then
|
I encountered the same problem: https://stackoverflow.com/questions/61455302/leave-transition-does-not-work-when-ngif-is-on-parent-component |
I encountered a similar issue without the @Component({
template: `
<parent [@animateBorder]="isOpen">
<child [@animateWidth]="isOpen"></child>
</parent>
`
animations: [animateBorder, animateWidth]
})
class MyComponent {
@Input() isOpen = true;
} The
|
I'm submitting a...
Current behavior
Parent ngIf does not wait for child animation to finish before killing it, apparently only if child's animation does not use :leave.
Issue #15798 and #18305 are about the same thing. The user dharders said:
but I would like to have the usage of that method for custom states.
Expected behavior
Parent ngIf waits for child's animation to finish before removing it form the DOM.
Minimal reproduction of the problem with instructions
I have this for my child component
and for my parent component
What is the motivation / use case for changing the behavior?
So child animations are respected when parent is about to be hidden.
Environment
The text was updated successfully, but these errors were encountered: