From 177586c98538993afceff3dad7ceddcaf1637b22 Mon Sep 17 00:00:00 2001 From: spencrmartin Date: Thu, 25 Sep 2025 13:16:53 -0400 Subject: [PATCH] Fix spell check focus issues and prevent input clearing - Added focus preservation after clicking misspelled words to maintain typing ability - Improved stale result detection by checking current textarea value instead of closure value - Removed problematic value dependency from performSpellCheck to prevent callback recreation - Ensures textarea stays focused and responsive during spell check interactions --- ui/desktop/src/components/RichChatInput.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/desktop/src/components/RichChatInput.tsx b/ui/desktop/src/components/RichChatInput.tsx index 68cc20493e..44569bd146 100644 --- a/ui/desktop/src/components/RichChatInput.tsx +++ b/ui/desktop/src/components/RichChatInput.tsx @@ -545,6 +545,13 @@ export const RichChatInput = forwardRef(({ e.preventDefault(); e.stopPropagation(); + // Ensure textarea maintains focus after click + setTimeout(() => { + if (hiddenTextareaRef.current) { + hiddenTextareaRef.current.focus(); + } + }, 0); + if (misspelledData) { const rect = e.currentTarget.getBoundingClientRect(); console.log('🖱️ CLICK: Element rect:', rect);