do not mutate node object when selecting

This commit is contained in:
peterkogo
2025-09-30 18:04:04 +02:00
parent 01a90ec2a6
commit a31af8ecab

View File

@@ -241,8 +241,7 @@ export function createStore<NodeType extends Node = Node, EdgeType extends Edge
// we need to mutate the node here in order to have the correct selected state in the drag handler
const internalNode = store.nodeLookup.get(node.id);
if (internalNode) internalNode.selected = selected;
node.selected = selected;
return { ...node };
return { ...node, selected };
}
return node;
});