From 534ba9e4f0a4ae6c862fef3a558bca3ece080844 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 6 Mar 2024 11:09:04 -0800 Subject: [PATCH] fix: message edit textarea height --- src/lib/components/chat/Messages/ResponseMessage.svelte | 1 + src/lib/components/chat/Messages/UserMessage.svelte | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte index f1237f771..a52b0967d 100644 --- a/src/lib/components/chat/Messages/ResponseMessage.svelte +++ b/src/lib/components/chat/Messages/ResponseMessage.svelte @@ -344,6 +344,7 @@ class=" bg-transparent outline-none w-full resize-none" bind:value={editedContent} on:input={(e) => { + e.target.style.height = ''; e.target.style.height = `${e.target.scrollHeight}px`; }} /> diff --git a/src/lib/components/chat/Messages/UserMessage.svelte b/src/lib/components/chat/Messages/UserMessage.svelte index 18c9b6700..d5e8b81fd 100644 --- a/src/lib/components/chat/Messages/UserMessage.svelte +++ b/src/lib/components/chat/Messages/UserMessage.svelte @@ -168,7 +168,8 @@ class=" bg-transparent outline-none w-full resize-none" bind:value={editedContent} on:input={(e) => { - messageEditTextAreaElement.style.height = `${messageEditTextAreaElement.scrollHeight}px`; + e.target.style.height = ''; + e.target.style.height = `${e.target.scrollHeight}px`; }} />