llama-cpp-compiled / tools /ui /src /lib /utils /autoresize-textarea.ts
Felipe97's picture
Upload folder using huggingface_hub (part 11)
82be208 verified
Raw History Blame Contribute Delete
366 Bytes
/**
* Automatically resizes a textarea element to fit its content
* @param textareaElement - The textarea element to resize
*/
export default function autoResizeTextarea(textareaElement: HTMLTextAreaElement | null): void {
if (textareaElement) {
textareaElement.style.height = '1rem';
textareaElement.style.height = textareaElement.scrollHeight + 'px';
}
}