From 3b60eb4aceb1382623ac96cd1d0bc15db39a2ec7 Mon Sep 17 00:00:00 2001 From: Jessica Janiuk Date: Fri, 3 Oct 2025 07:43:27 -0700 Subject: [PATCH] refactor(core): allow animationend to process if we don't have a longest animation (#64225) There may be cases where the longest animation info has been cleaned up before the end animation fires. We should still do the end processing in that case. PR Close #64225 --- packages/core/src/animation/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/src/animation/utils.ts b/packages/core/src/animation/utils.ts index 15a9c9b5492..756c08b1bb1 100644 --- a/packages/core/src/animation/utils.ts +++ b/packages/core/src/animation/utils.ts @@ -233,9 +233,11 @@ export function isLongestAnimation( nativeElement: HTMLElement, ): boolean { const longestAnimation = longestAnimations.get(nativeElement); + // If we don't have any record of a longest animation, then we shouldn't + // block the animationend/transitionend event from doing its work. + if (longestAnimation === undefined) return true; return ( nativeElement === event.target && - longestAnimation !== undefined && ((longestAnimation.animationName !== undefined && (event as AnimationEvent).animationName === longestAnimation.animationName) || (longestAnimation.propertyName !== undefined &&