From dbe82a718aa5e7813f10406b91dd0e91cf0c3461 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Tue, 23 Nov 2021 16:17:46 +0100 Subject: [PATCH] fix: node selection not working if selectable === undefined * selectable has to be explicitly false for node selection to skip the node Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com> --- src/utils/graph.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/graph.ts b/src/utils/graph.ts index 5b788614..09a24e70 100644 --- a/src/utils/graph.ts +++ b/src/utils/graph.ts @@ -242,7 +242,7 @@ export const getNodesInside = (nodes: GraphNode[], rect: Rect, [tx, ty, tScale]: }) return nodes.filter((node) => { - if (!node.__vf || !node.selectable) return false + if (!node.__vf || node.selectable === false) return false const { position = { x: 0, y: 0 }, width = 0, height = 0, isDragging = false } = node.__vf const nBox = rectToBox({ ...position, width, height } as any) const xOverlap = Math.max(0, Math.min(rBox.x2, nBox.x2) - Math.max(rBox.x, nBox.x))