Merge pull request #2648 from wbkd/refactor/edge-panning
refactor(panning): allow middle mouse pan over edge closes #2621
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'@reactflow/core': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Allow middle mouse pan over edges
|
||||||
@@ -228,7 +228,11 @@ const ZoomPane = ({
|
|||||||
const zoomScroll = zoomActivationKeyPressed || zoomOnScroll;
|
const zoomScroll = zoomActivationKeyPressed || zoomOnScroll;
|
||||||
const pinchZoom = zoomOnPinch && event.ctrlKey;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user