From 4ac41bc4b1e5b7652c94dcc1fe77dcfd3797789d Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Sat, 19 Aug 2023 17:46:35 +1000 Subject: [PATCH] feat(ui): adding node selects new node exclusively --- .../web/src/features/nodes/store/nodesSlice.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts b/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts index a8ce447c09..816a326ae0 100644 --- a/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts +++ b/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts @@ -144,6 +144,18 @@ const nodesSlice = createSlice({ node.position.y ); node.position = position; + node.selected = true; + + state.nodes = applyNodeChanges( + state.nodes.map((n) => ({ id: n.id, type: 'select', selected: false })), + state.nodes + ); + + state.edges = applyEdgeChanges( + state.edges.map((e) => ({ id: e.id, type: 'select', selected: false })), + state.edges + ); + state.nodes.push(node); if (!isInvocationNode(node)) {