mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(animation): animations of duration 0 now run in Safari (#19287)
fixes #19285
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user