diff --git a/src/OrgAst.tsx b/src/OrgAst.tsx index cd72319..e700415 100644 --- a/src/OrgAst.tsx +++ b/src/OrgAst.tsx @@ -15,8 +15,9 @@ const OrgAst = (props: { function selectNode(uid: string, start: number, end: number) { if (selectedNode !== null && selectedNode.uid === uid) { - props.setHighlight([hoveredNode].filter((node) => node !== null)); + props.setHighlight([]); setSelectedNode(null); + setHoveredNode(null); } else { const new_node: OrgNodeReference = { uid: uid, start: start, end: end }; props.setHighlight(