From 3dc375034e4129efaca3c819d3e45aabd1431d2b Mon Sep 17 00:00:00 2001 From: Akash Kava <39438041+ackava@users.noreply.github.com> Date: Fri, 13 Sep 2024 13:45:09 +0530 Subject: [PATCH] scroll prevented --- src/basic/PinchZoomView.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/basic/PinchZoomView.tsx b/src/basic/PinchZoomView.tsx index ff15b7d0..75a70992 100644 --- a/src/basic/PinchZoomView.tsx +++ b/src/basic/PinchZoomView.tsx @@ -93,8 +93,8 @@ export default class PinchZoomView extends AtomControl { this.bindEvent(scrollView, "touchstart", (evs: TouchEvent) => { previous = center(evs); - evs.preventDefault(); - evs.stopImmediatePropagation?.(); + // evs.preventDefault(); + // evs.stopImmediatePropagation?.(); // const start = this.zoom.scale; @@ -121,6 +121,10 @@ export default class PinchZoomView extends AtomControl { if (previousDistance === newScale) { return; } + + ev.preventDefault(); + ev.stopImmediatePropagation(); + scale += newScale - previousDistance; previousDistance = newScale; this.updateZoom({