Skip to content

Commit

Permalink
fix(animation): animations of duration 0 now run in Safari (#19287)
Browse files Browse the repository at this point in the history
fixes #19285
  • Loading branch information
liamdebeasi committed Sep 10, 2019
1 parent a3f345c commit 4e544f1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/src/utils/animation/animation.ts
Expand Up @@ -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);
Expand Down

0 comments on commit 4e544f1

Please sign in to comment.