Merge pull request #4341 from xyflow/fix-zoom-on-pinch-mobile

prevent zooming on mobile if zoomOnPinch is false
This commit is contained in:
Moritz Klack
2024-06-06 12:55:43 +02:00
committed by GitHub

View File

@@ -65,6 +65,11 @@ export function createFilter({
return false;
}
if (!zoomOnPinch && event.type === 'touchstart' && event.touches?.length > 1) {
event.preventDefault(); // if you manage to start with 2 touches, we prevent native zoom
return false;
}
// when there is no scroll handling enabled, we prevent all wheel events
if (!zoomScroll && !panOnScroll && !pinchZoom && event.type === 'wheel') {
return false;