Skip to content

Commit

Permalink
fix(animation): reset all temporary flags when interrupting an animat…
Browse files Browse the repository at this point in the history
…ion (#20627)

fixes #20602
  • Loading branch information
liamdebeasi committed Feb 27, 2020
1 parent b84822e commit 0e0e401
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions core/src/utils/animation/animation.ts
Expand Up @@ -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 });
Expand Down Expand Up @@ -886,6 +898,8 @@ export const createAnimation = (animationId?: string): Animation => {
cleanUpElements();
initialized = false;
}

resetFlags();
};

const from = (property: string, value: any) => {
Expand Down

0 comments on commit 0e0e401

Please sign in to comment.