Merge pull request #2648 from wbkd/refactor/edge-panning

refactor(panning): allow middle mouse pan over edge closes #2621
This commit is contained in:
Moritz Klack
2022-12-06 17:21:40 +01:00
committed by GitHub
2 changed files with 10 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@reactflow/core': patch
---
Allow middle mouse pan over edges
@@ -228,7 +228,11 @@ const ZoomPane = ({
const zoomScroll = zoomActivationKeyPressed || zoomOnScroll;
const pinchZoom = zoomOnPinch && event.ctrlKey;
if (event.button === 1 && event.type === 'mousedown' && event.target.closest(`.react-flow__node`)) {
if (
event.button === 1 &&
event.type === 'mousedown' &&
(event.target.closest('.react-flow__node') || event.target.closest('.react-flow__edge'))
) {
return true;
}