fix(core): allow middle mouse pan over edges

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2022-12-06 17:36:59 +01:00
committed by Braks
parent c673b04422
commit 0d44179373

View File

@@ -191,7 +191,13 @@ onMounted(() => {
const zoomScroll = zoomKeyPressed.value || zoomOnScroll
const pinchZoom = zoomOnPinch && event.ctrlKey
if (event.button === 1 && event.type === 'mousedown' && (event.target as HTMLElement)?.closest(`.vue-flow__node`)) return true
if (
event.button === 1 &&
event.type === 'mousedown' &&
((event.target as HTMLElement)?.closest(`.vue-flow__node`) || (event.target as HTMLElement)?.closest(`.vue-flow__edge`))
) {
return true
}
// if all interactions are disabled, we prevent all zoom events
if (!panOnDrag && !zoomScroll && !panOnScroll && !zoomOnDoubleClick && !zoomOnPinch) return false