Skip to content

Commit

Permalink
fix: reset input height on submission (#679)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyphilemon authored Jan 8, 2025
1 parent 3e34d67 commit 7a18974
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/multimodal-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
'',
Expand Down Expand Up @@ -119,6 +126,7 @@ function PureMultimodalInput({

setAttachments([]);
setLocalStorageInput('');
resetHeight();

if (width && width > 768) {
textareaRef.current?.focus();
Expand Down

0 comments on commit 7a18974

Please sign in to comment.