From 4ddd8b06e596b54986c108829c9f930edbf7e47b Mon Sep 17 00:00:00 2001 From: Drew Hess Date: Thu, 1 Jun 2023 01:04:09 +0100 Subject: [PATCH] feat: pan the canvas regardless of what's underneath the pointer Prior to this change, panning could be quite frustrating, because if the cursor was placed over a node or an edge of a `ReactFlow`, the flow didn't propagate the pan/drag event to the underlying canvas. Now it works everywhere on the canvas, regardless of what's underneath the cursor. Signed-off-by: Drew Hess --- src/components/TreeReactFlow/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/TreeReactFlow/index.tsx b/src/components/TreeReactFlow/index.tsx index 54794032..98a2d3bb 100644 --- a/src/components/TreeReactFlow/index.tsx +++ b/src/components/TreeReactFlow/index.tsx @@ -794,6 +794,10 @@ export const ReactFlowSafe = < // box of the canvas. minZoom: 0.001, edgeTypes, + nodesDraggable: false, + // Note that despite the name, we can still select nodes in + // the tree in order to perform actions on them. + elementsSelectable: false, onNodeClick: (e, n) => { "onNodeClick" in p && p.onNodeClick(