From ec4a88b7171222811c5a0ea1c01e06f7dd2d1ca7 Mon Sep 17 00:00:00 2001 From: George Thomas Date: Wed, 22 Mar 2023 17:03:27 +0000 Subject: [PATCH] (hack) select node when parent edge is clicked --- src/components/TreeReactFlow/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/TreeReactFlow/index.tsx b/src/components/TreeReactFlow/index.tsx index 85531469..0245e3f7 100644 --- a/src/components/TreeReactFlow/index.tsx +++ b/src/components/TreeReactFlow/index.tsx @@ -295,7 +295,10 @@ const makePrimerNode = async ( target: child.id, style: { cursor: "default" }, focusable: false, - interactionWidth: 0, + ...(child.type != "primer-def-name" && + !flavorClasses(child.data.flavor).includes(commonHoverClasses) && { + interactionWidth: 0, + }), zIndex, }); switch (node.body.tag) { @@ -507,7 +510,6 @@ export const TreeReactFlow = (p: TreeReactFlowProps) => { className: "stroke-grey-tertiary stroke-[0.25rem]", style: { strokeDasharray: 4, cursor: "default" }, focusable: false, - interactionWidth: 0, zIndex: 0, }, ], @@ -658,6 +660,10 @@ export const ReactFlowSafe = ( { + "onNodeClick" in p && + p.onNodeClick(e, p.nodes.find((n) => n.id == edge.target) as N); + }, onNodeClick: (e, n) => { "onNodeClick" in p && p.onNodeClick(