mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
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
This commit is contained in:
@@ -1006,6 +1006,12 @@ export const RichChatInput = forwardRef<RichChatInputRef, RichChatInputProps>(({
|
||||
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) +
|
||||
|
||||
Reference in New Issue
Block a user