From 4e544f1d904573734c0f25ca9df4ad757ffdd075 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Tue, 10 Sep 2019 11:27:11 -0400 Subject: [PATCH] fix(animation): animations of duration 0 now run in Safari (#19287) fixes #19285 --- core/src/utils/animation/animation.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/utils/animation/animation.ts b/core/src/utils/animation/animation.ts index 8aca4c692b5..68ab2c6c6bc 100644 --- a/core/src/utils/animation/animation.ts +++ b/core/src/utils/animation/animation.ts @@ -410,6 +410,15 @@ export const createAnimation = () => { * to complete one cycle. */ const duration = (animationDuration: number) => { + /** + * CSS Animation Durations of 0ms work fine on Chrome + * but do not run on Safari, so force it to 1ms to + * get it to run on both platforms. + */ + if (!supportsWebAnimations && animationDuration === 0) { + animationDuration = 1; + } + _duration = animationDuration; update(true);