Merge pull request #5512 from xyflow/fix-nowheel-zoom

Fix nowheel zoom
This commit is contained in:
Moritz Klack
2025-09-18 08:27:13 +02:00
committed by GitHub
2 changed files with 10 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
---
'@xyflow/system': patch
'@xyflow/react': patch
'@xyflow/svelte': patch
---
Prevent native page zoom when pinch zooming on node with nowheel class

View File

@@ -72,6 +72,9 @@ export function createPanOnScrollHandler({
}: PanOnScrollParams) {
return (event: any) => {
if (isWrappedWithClass(event, noWheelClassName)) {
if (event.ctrlKey) {
event.preventDefault(); // stop native page zoom for pinch zooming
}
return false;
}
event.preventDefault();