mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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:
committed by
Miles Malerba
parent
a52a2afb6e
commit
3b60eb4ace
@@ -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 &&
|
||||
|
||||
Reference in New Issue
Block a user