fix(animation): reset all temporary flags when interrupting an animation (#20627)

fixes #20602
This commit is contained in:
Liam DeBeasi
2020-02-27 11:17:43 -05:00
committed by GitHub
parent b84822e674
commit 0e0e401d86

View File

@ -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) => {