From 0e0e401d86dabaa1dc804656e4d384154d6fdd05 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Thu, 27 Feb 2020 11:17:43 -0500 Subject: [PATCH] fix(animation): reset all temporary flags when interrupting an animation (#20627) fixes #20602 --- core/src/utils/animation/animation.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/src/utils/animation/animation.ts b/core/src/utils/animation/animation.ts index 889bfbdcb6..713d015233 100644 --- a/core/src/utils/animation/animation.ts +++ b/core/src/utils/animation/animation.ts @@ -102,6 +102,18 @@ export const createAnimation = (animationId?: string): Animation => { cleanUpStyleSheets(); }; + const resetFlags = () => { + shouldForceLinearEasing = false; + shouldForceSyncPlayback = false; + shouldCalculateNumAnimations = true; + forceDirectionValue = undefined; + forceDurationValue = undefined; + forceDelayValue = undefined; + numAnimationsRunning = 0; + finished = false; + willComplete = true; + }; + const onFinish = (callback: AnimationLifecycle, opts?: AnimationCallbackOptions) => { const callbacks = (opts && opts.oneTimeCallback) ? onFinishOneTimeCallbacks : onFinishCallbacks; callbacks.push({ c: callback, o: opts }); @@ -886,6 +898,8 @@ export const createAnimation = (animationId?: string): Animation => { cleanUpElements(); initialized = false; } + + resetFlags(); }; const from = (property: string, value: any) => {