fix(core): trigger host animations for elements that are removed. (#15251)
Fixes #14813 Fixes #15193
This commit is contained in:

committed by
Miško Hevery

parent
28ce68a13d
commit
0d3e314df0
@ -90,7 +90,15 @@ export class AnimationRenderer implements Renderer2 {
|
||||
}
|
||||
|
||||
removeChild(parent: any, oldChild: any): void {
|
||||
this._engine.onRemove(oldChild, () => this.delegate.removeChild(parent, oldChild));
|
||||
this._engine.onRemove(oldChild, () => {
|
||||
// Note: if an component element has a leave animation, and the component
|
||||
// a host leave animation, the view engine will call `removeChild` for the parent
|
||||
// component renderer as well as for the child component renderer.
|
||||
// Therefore, we need to check if we already removed the element.
|
||||
if (this.delegate.parentNode(oldChild)) {
|
||||
this.delegate.removeChild(parent, oldChild);
|
||||
}
|
||||
});
|
||||
this._queueFlush();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user