From fd830cdfec3231f416234afdeb2c5516d41ff734 Mon Sep 17 00:00:00 2001 From: spencrmartin Date: Fri, 31 Oct 2025 09:22:26 -0400 Subject: [PATCH] Add explicit useEffect to sync height on value changes - Ensures syncDisplayHeight runs whenever value prop changes - Fixes issue where height wasn't recalculating on text deletion - Complements existing ResizeObserver with direct value monitoring --- ui/desktop/src/components/RichChatInput.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui/desktop/src/components/RichChatInput.tsx b/ui/desktop/src/components/RichChatInput.tsx index cbaa14fd12..e85f24ce33 100644 --- a/ui/desktop/src/components/RichChatInput.tsx +++ b/ui/desktop/src/components/RichChatInput.tsx @@ -1006,6 +1006,12 @@ export const RichChatInput = forwardRef(({ const cleanup = monitorTextareaChanges(); return cleanup; }, [monitorTextareaChanges]); + + // Explicitly sync height whenever value changes (including when text is deleted) + useEffect(() => { + syncDisplayHeight(); + ensureStyleConsistency(); + }, [value, syncDisplayHeight, ensureStyleConsistency]); // Tooltip handlers const handleSuggestionSelect = useCallback((suggestion: string) => { const newValue = value.slice(0, tooltip.wordStart) +