fix(animation): animation timer fallback now accounts for iterations (#19527)

This commit is contained in:
Liam DeBeasi
2019-10-02 10:41:29 -04:00
committed by GitHub
parent 3c846a7b06
commit 9f5ed231c3
8 changed files with 11 additions and 9 deletions

View File

@ -949,8 +949,9 @@ export const createAnimation = () => {
*/
const animationDelay = getDelay() || 0;
const animationDuration = getDuration() || 0;
const animationIterations = getIterations() || 1;
cssAnimationsTimerFallback = setTimeout(onAnimationEndFallback, animationDelay + animationDuration + ANIMATION_END_FALLBACK_PADDING_MS);
cssAnimationsTimerFallback = setTimeout(onAnimationEndFallback, animationDelay + (animationDuration * animationIterations) + ANIMATION_END_FALLBACK_PADDING_MS);
animationEnd(elements[0], () => {
clearCSSAnimationsTimeout();