From 3fe332e85ff5408cd79bb8aaa6d1e8ee94acd097 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Sun, 7 Jan 2024 14:00:22 +1100 Subject: [PATCH] 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. --- .../nodes/components/flow/AddNodePopover/AddNodePopover.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/AddNodePopover/AddNodePopover.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/AddNodePopover/AddNodePopover.tsx index b798fec9b4..85669fb3c6 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/AddNodePopover/AddNodePopover.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/AddNodePopover/AddNodePopover.tsx @@ -155,8 +155,9 @@ const AddNodePopover = () => { return; } addNode(v.value); + dispatch(addNodePopoverClosed()); }, - [addNode] + [addNode, dispatch] ); const onClose = useCallback(() => { @@ -235,6 +236,7 @@ const AddNodePopover = () => { onMenuClose={onClose} onKeyDown={onKeyDown} inputRef={inputRef} + closeMenuOnSelect={false} />