From d3466d766fe4546a2e769eaa42945df3a7e9f5af Mon Sep 17 00:00:00 2001 From: Alex Rennie-Lis Date: Mon, 29 Jun 2026 01:06:45 +0100 Subject: [PATCH] Mobile fix for touch --- src/routes/+page.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 8f20f7b..d3c5f37 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -144,6 +144,7 @@ function handleMouseDown(e) { pointerDown(e.clientX, e.clientY, e.target); } function handleMouseMove(e) { pointerMove(e.clientX, e.clientY, () => e.preventDefault()); } + // Mobile Touch Panning Adapters // Mobile Touch Panning Adapters function handleTouchStart(e) { if (isZoomed) { @@ -155,7 +156,7 @@ } function handleTouchMove(e) { - if (isZoomed) { + if (isZoomed && e.touches.length === 1) { // 👈 Ensures single finger panning behaves correctly const touch = e.touches[0]; pointerMove(touch.clientX, touch.clientY, () => e.preventDefault()); } @@ -217,7 +218,7 @@ onclick={(e) => { if (e.target === e.currentTarget) activePhoto = null; }} onkeydown={handleKeyDown} ontouchstart={handleTouchStart} - onttouchmove={handleTouchMove} + ontouchmove={handleTouchMove} ontouchend={handleTouchEnd} >