Skip to content

Commit 3fe332e

Browse files
fix(ui): fix add node autoconnect
The new select component appears to close itself before calling the onchange handler. This short-circuits the autoconnect logic. Tweaked so the ordering is correct.
1 parent 3428ea1 commit 3fe332e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

invokeai/frontend/web/src/features/nodes/components/flow/AddNodePopover/AddNodePopover.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,9 @@ const AddNodePopover = () => {
155155
return;
156156
}
157157
addNode(v.value);
158+
dispatch(addNodePopoverClosed());
158159
},
159-
[addNode]
160+
[addNode, dispatch]
160161
);
161162

162163
const onClose = useCallback(() => {
@@ -235,6 +236,7 @@ const AddNodePopover = () => {
235236
onMenuClose={onClose}
236237
onKeyDown={onKeyDown}
237238
inputRef={inputRef}
239+
closeMenuOnSelect={false}
238240
/>
239241
</InvPopoverBody>
240242
</InvPopoverContent>

0 commit comments

Comments
 (0)