Remove highlight when deselecting node despite hover status.

This commit is contained in:
Tom Alexander 2024-01-28 02:04:00 -05:00
parent f89e62b9e1
commit 6129bdad3e
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -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(