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
This commit is contained in:
Jessica Janiuk 2025-10-03 07:43:27 -07:00 committed by Miles Malerba
parent a52a2afb6e
commit 3b60eb4ace

View file

@ -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 &&