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
This commit is contained in:
spencrmartin
2025-09-25 13:16:53 -04:00
committed by Alex Hancock
parent 23f285239e
commit 177586c985
@@ -545,6 +545,13 @@ export const RichChatInput = forwardRef<RichChatInputRef, RichChatInputProps>(({
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);