mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
perf(animations): do not create setTimeout if infinite iterations (#19632)
closes #19627
This commit is contained in:
@ -819,7 +819,10 @@ export const createAnimation = (): Animation => {
|
|||||||
const animationDuration = getDuration() || 0;
|
const animationDuration = getDuration() || 0;
|
||||||
const animationIterations = getIterations() || 1;
|
const animationIterations = getIterations() || 1;
|
||||||
|
|
||||||
|
// No need to set a timeout when animation has infinite iterations
|
||||||
|
if (isFinite(animationIterations)) {
|
||||||
cssAnimationsTimerFallback = setTimeout(onAnimationEndFallback, animationDelay + (animationDuration * animationIterations) + ANIMATION_END_FALLBACK_PADDING_MS);
|
cssAnimationsTimerFallback = setTimeout(onAnimationEndFallback, animationDelay + (animationDuration * animationIterations) + ANIMATION_END_FALLBACK_PADDING_MS);
|
||||||
|
}
|
||||||
|
|
||||||
animationEnd(elements[0], () => {
|
animationEnd(elements[0], () => {
|
||||||
clearCSSAnimationsTimeout();
|
clearCSSAnimationsTimeout();
|
||||||
|
Reference in New Issue
Block a user