From d9d2eee3c9210336e355b2033034885c3d299acc Mon Sep 17 00:00:00 2001 From: Minh-Phuc Tran Date: Fri, 3 Jan 2025 16:18:41 +0700 Subject: [PATCH] Adjust prompt input height when minRows changes --- src/prompt-input/internal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prompt-input/internal.tsx b/src/prompt-input/internal.tsx index 805530536f..d9bb16d8bc 100644 --- a/src/prompt-input/internal.tsx +++ b/src/prompt-input/internal.tsx @@ -111,7 +111,7 @@ const InternalPromptInput = React.forwardRef( const minTextareaHeight = `calc(${LINE_HEIGHT} + ${tokens.spaceScaledXxs} * 2)`; // the min height of Textarea with 1 row textareaRef.current.style.height = `min(max(${scrollHeight}, ${minTextareaHeight}), ${maxRowsHeight})`; } - }, [maxRows, LINE_HEIGHT, PADDING]); + }, [minRows, maxRows, LINE_HEIGHT, PADDING]); useEffect(() => { const handleResize = () => {