From 7a189743a13d25fffea153e1059ee048780ad8d1 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Wed, 8 Jan 2025 17:00:38 +0530 Subject: [PATCH] fix: reset input height on submission (#679) --- components/multimodal-input.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/multimodal-input.tsx b/components/multimodal-input.tsx index b0d98632a..191470534 100644 --- a/components/multimodal-input.tsx +++ b/components/multimodal-input.tsx @@ -81,6 +81,13 @@ function PureMultimodalInput({ } }; + const resetHeight = () => { + if (textareaRef.current) { + textareaRef.current.style.height = 'auto'; + textareaRef.current.style.height = '98px'; + } + }; + const [localStorageInput, setLocalStorageInput] = useLocalStorage( 'input', '', @@ -119,6 +126,7 @@ function PureMultimodalInput({ setAttachments([]); setLocalStorageInput(''); + resetHeight(); if (width && width > 768) { textareaRef.current?.focus();