From 36025b28b05c63dd7d3030836327290a72d6d895 Mon Sep 17 00:00:00 2001 From: moklick Date: Thu, 10 Dec 2020 12:07:36 +0100 Subject: [PATCH] refactor(zoom): add nowheel helper class closes #719 --- src/container/ZoomPane/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/container/ZoomPane/index.tsx b/src/container/ZoomPane/index.tsx index 1c18caef..202856fc 100644 --- a/src/container/ZoomPane/index.tsx +++ b/src/container/ZoomPane/index.tsx @@ -188,6 +188,10 @@ const ZoomPane = ({ return false; } + if (event.target.closest('.nowheel') && event.type === 'wheel') { + return false; + } + // when the target element is a node, we still allow zooming if ( (event.target.closest('.react-flow__node') || event.target.closest('.react-flow__edgeupdater')) &&