refactor(panning): allow middle mouse pan over edge closes #2621

This commit is contained in:
moklick
2022-12-06 17:20:12 +01:00
parent 8d36d56923
commit 0a2c13d468
@@ -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;
}