From fcd3ef1f98049acc39add780097503fd34a88695 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Thu, 24 Nov 2022 13:18:12 +1100 Subject: [PATCH] Fixes invoke hotkey not working in input fields --- .../options/components/ProcessButtons/InvokeButton.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/features/options/components/ProcessButtons/InvokeButton.tsx b/frontend/src/features/options/components/ProcessButtons/InvokeButton.tsx index 97b11323df..30aab9744c 100644 --- a/frontend/src/features/options/components/ProcessButtons/InvokeButton.tsx +++ b/frontend/src/features/options/components/ProcessButtons/InvokeButton.tsx @@ -27,9 +27,12 @@ export default function InvokeButton(props: InvokeButton) { useHotkeys( ['ctrl+enter', 'meta+enter'], () => { - if (isReady) { - dispatch(generateImage(activeTabName)); - } + dispatch(generateImage(activeTabName)); + }, + { + enabled: () => isReady, + preventDefault: true, + enableOnFormTags: ['input', 'textarea', 'select'], }, [isReady, activeTabName] );