diff --git a/packages/core/src/animation/element_removal_registry.ts b/packages/core/src/animation/element_removal_registry.ts index fa7b7708123..82056f0121a 100644 --- a/packages/core/src/animation/element_removal_registry.ts +++ b/packages/core/src/animation/element_removal_registry.ts @@ -65,6 +65,7 @@ export class ElementRegistry { const details = this.outElements.get(el) ?? { classes: null, animateFn: () => {}, + isEventBinding: true, }; details.animateFn = animateWrapperFn(el, value); this.outElements.set(el, details); @@ -75,6 +76,7 @@ export class ElementRegistry { const details = this.outElements.get(el) ?? { classes: new Set(), animateFn: (): void => {}, + isEventBinding: false, }; if (typeof value === 'function') { this.trackResolver(details, value); @@ -109,8 +111,11 @@ export class ElementRegistry { }; // this timeout is used to ensure elements actually get removed in the case // that the user forgot to call the remove callback. The timeout is cleared - // in the DOM renderer during the remove child process. - timeoutId = setTimeout(remove, maxAnimationTimeout); + // in the DOM renderer during the remove child process. It only applies + // to the event binding use case. + if (details.isEventBinding) { + timeoutId = setTimeout(remove, maxAnimationTimeout); + } details.animateFn(remove); } } diff --git a/packages/core/src/animation/interfaces.ts b/packages/core/src/animation/interfaces.ts index 5eb3da353d5..ae91b9623c5 100644 --- a/packages/core/src/animation/interfaces.ts +++ b/packages/core/src/animation/interfaces.ts @@ -67,4 +67,5 @@ export interface AnimationDetails { classes: Set | null; classFns?: Function[]; animateFn: AnimationRemoveFunction; + isEventBinding: boolean; }