From 759eb92c075442b76a1a262e197a95514413b335 Mon Sep 17 00:00:00 2001 From: Jessica Janiuk Date: Tue, 21 Oct 2025 10:19:21 -0700 Subject: [PATCH] fix(core): pass element removal property through in all locations The `requireSynchronousElementRemoval` property was not being passed in all the locations it was needed. This was preventing leave animation timing from behaving properly in some cases. fixes: #64525 --- packages/animations/browser/src/render/renderer.ts | 2 +- .../animations/async/src/async_animation_renderer.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/animations/browser/src/render/renderer.ts b/packages/animations/browser/src/render/renderer.ts index 435d82c1462e..dac743323eb3 100644 --- a/packages/animations/browser/src/render/renderer.ts +++ b/packages/animations/browser/src/render/renderer.ts @@ -89,7 +89,7 @@ export class BaseAnimationRenderer implements Renderer2 { // Elements using the new `animate.leave` API require synchronous removal and should // skip the rest of the legacy animation behaviors. if (requireSynchronousElementRemoval) { - this.delegate.removeChild(parent, oldChild, isHostElement); + this.delegate.removeChild(parent, oldChild, isHostElement, requireSynchronousElementRemoval); return; } // Prior to the changes in #57203, this method wasn't being called at all by `core` if the child diff --git a/packages/platform-browser/animations/async/src/async_animation_renderer.ts b/packages/platform-browser/animations/async/src/async_animation_renderer.ts index 44a16ed3a941..daec1d0ac8b8 100644 --- a/packages/platform-browser/animations/async/src/async_animation_renderer.ts +++ b/packages/platform-browser/animations/async/src/async_animation_renderer.ts @@ -238,8 +238,13 @@ export class DynamicDelegationRenderer implements Renderer2 { this.delegate.insertBefore(parent, newChild, refChild, isMove); } - removeChild(parent: any, oldChild: any, isHostElement?: boolean | undefined): void { - this.delegate.removeChild(parent, oldChild, isHostElement); + removeChild( + parent: any, + oldChild: any, + isHostElement?: boolean | undefined, + requireSynchronousElementRemoval?: boolean, + ): void { + this.delegate.removeChild(parent, oldChild, isHostElement, requireSynchronousElementRemoval); } selectRootElement(selectorOrNode: any, preserveContent?: boolean | undefined): any {