From 3fb4e3050c218b7d550c35bfc508dce6d027e85c Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:14:25 +1000 Subject: [PATCH] feat(ui): focus in textarea after inserting placeholder --- .../components/StylePresetForm/StylePresetPromptField.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/invokeai/frontend/web/src/features/stylePresets/components/StylePresetForm/StylePresetPromptField.tsx b/invokeai/frontend/web/src/features/stylePresets/components/StylePresetForm/StylePresetPromptField.tsx index 44b38931e2..32c8a51661 100644 --- a/invokeai/frontend/web/src/features/stylePresets/components/StylePresetForm/StylePresetPromptField.tsx +++ b/invokeai/frontend/web/src/features/stylePresets/components/StylePresetForm/StylePresetPromptField.tsx @@ -39,6 +39,8 @@ export const StylePresetPromptField = (props: Props) => { } else { field.onChange(value + PRESET_PLACEHOLDER); } + + textareaRef.current?.focus(); }, [value, field, textareaRef]); const isPromptPresent = useMemo(() => value?.includes(PRESET_PLACEHOLDER), [value]);