diff --git a/src/lib/components/chat/Messages/UserMessage.svelte b/src/lib/components/chat/Messages/UserMessage.svelte index 6f41c5df..0a547227 100644 --- a/src/lib/components/chat/Messages/UserMessage.svelte +++ b/src/lib/components/chat/Messages/UserMessage.svelte @@ -20,18 +20,17 @@ let edit = false; let editedContent = ''; - + let messageEditTextArea: HTMLTextAreaElement; const editMessageHandler = async () => { edit = true; editedContent = message.content; await tick(); - const editElement = document.getElementById(`message-edit-${message.id}`); - editElement.style.height = ''; - editElement.style.height = `${editElement.scrollHeight}px`; + messageEditTextArea.style.height = ''; + messageEditTextArea.style.height = `${messageEditTextArea.scrollHeight}px`; - editElement?.focus(); + messageEditTextArea?.focus(); }; const editMessageConfirmHandler = async () => { @@ -165,10 +164,11 @@