fix: reset input height on submission (#679)
This commit is contained in:
parent
3e34d678b3
commit
7a189743a1
1 changed files with 8 additions and 0 deletions
|
|
@ -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(
|
const [localStorageInput, setLocalStorageInput] = useLocalStorage(
|
||||||
'input',
|
'input',
|
||||||
'',
|
'',
|
||||||
|
|
@ -119,6 +126,7 @@ function PureMultimodalInput({
|
||||||
|
|
||||||
setAttachments([]);
|
setAttachments([]);
|
||||||
setLocalStorageInput('');
|
setLocalStorageInput('');
|
||||||
|
resetHeight();
|
||||||
|
|
||||||
if (width && width > 768) {
|
if (width && width > 768) {
|
||||||
textareaRef.current?.focus();
|
textareaRef.current?.focus();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue