From 5bbff378d30107145383118675d0b617152f26eb Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 15 Apr 2023 01:30:20 +0800 Subject: [PATCH] Let's see if this fixes flash of cut-off images on Mobile Safari --- src/components/media.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/media.jsx b/src/components/media.jsx index d3857921..793f780a 100644 --- a/src/components/media.jsx +++ b/src/components/media.jsx @@ -49,7 +49,11 @@ function Media({ media, to, showOriginal, autoAnimate, onClick = () => {} }) { if (media) { const value = make3dTransformValue({ x, y, scale }); - media.style.setProperty('transform', value); + if (scale === 1) { + media.style.removeProperty('transform'); + } else { + media.style.setProperty('transform', value); + } media.closest('.media-zoom').style.touchAction = scale <= 1 ? 'pan-x' : '';