From d4463674cffb96a8278193e18e6d885fbd1c58ec Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Tue, 22 Aug 2023 23:42:51 +1200 Subject: [PATCH] fix: Move add node hotkey to the right component --- .../nodes/components/flow/AddNodePopover/AddNodePopover.tsx | 2 +- .../components/flow/panels/TopLeftPanel/TopLeftPanel.tsx | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) 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 05aa60c1ba..aba2ce6e6c 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 @@ -140,7 +140,7 @@ const AddNodePopover = () => { onClose(); }, [onClose]); - useHotkeys(['space', '/'], handleHotkeyOpen); + useHotkeys(['shift+a', 'space', '/'], handleHotkeyOpen); useHotkeys(['escape'], handleHotkeyClose); return ( diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopLeftPanel/TopLeftPanel.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopLeftPanel/TopLeftPanel.tsx index a5f1539b64..67471b7e3d 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopLeftPanel/TopLeftPanel.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopLeftPanel/TopLeftPanel.tsx @@ -2,7 +2,6 @@ import { useAppDispatch } from 'app/store/storeHooks'; import IAIButton from 'common/components/IAIButton'; import { addNodePopoverOpened } from 'features/nodes/store/nodesSlice'; import { memo, useCallback } from 'react'; -import { useHotkeys } from 'react-hotkeys-hook'; import { Panel } from 'reactflow'; const TopLeftPanel = () => { @@ -12,10 +11,6 @@ const TopLeftPanel = () => { dispatch(addNodePopoverOpened()); }, [dispatch]); - useHotkeys(['shift+a'], () => { - handleOpenAddNodePopover(); - }); - return (