fix(animation): animations of duration 0 now run in Safari (#19287)

fixes #19285
This commit is contained in:
Liam DeBeasi
2019-09-10 11:27:11 -04:00
committed by GitHub
parent a3f345c06d
commit 4e544f1d90

View File

@@ -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);