From 24e90a5cdb026f033e44ec4c14b9507508a242d7 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Tue, 28 Mar 2023 10:26:27 +0800 Subject: [PATCH] Allow pan carousel when image scale = 1 --- src/components/media.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/media.jsx b/src/components/media.jsx index 2fdbce39..585fa0e0 100644 --- a/src/components/media.jsx +++ b/src/components/media.jsx @@ -48,6 +48,8 @@ function Media({ media, showOriginal, autoAnimate, onClick = () => {} }) { const value = make3dTransformValue({ x, y, scale }); img.style.setProperty('transform', value); + + img.closest('.media-zoom').style.touchAction = scale === 1 ? 'pan-x' : ''; } }, []);