Mobile fix for touch
This commit is contained in:
@@ -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}
|
||||
>
|
||||
<div class="w-full flex justify-between items-center z-50 p-2 pointer-events-none">
|
||||
|
||||
Reference in New Issue
Block a user