rf: dom queries in ResponseMessageComponent

This commit is contained in:
Carlos Daniel Vilaseca 2024-03-03 17:30:08 -05:00
parent cc471597cd
commit 0fc76d46db

View file

@ -40,7 +40,7 @@
let edit = false; let edit = false;
let editedContent = ''; let editedContent = '';
let editElement: HTMLTextAreaElement;
let tooltipInstance = null; let tooltipInstance = null;
let sentencesAudio = {}; let sentencesAudio = {};
@ -247,7 +247,6 @@
editedContent = message.content; editedContent = message.content;
await tick(); await tick();
const editElement = document.getElementById(`message-edit-${message.id}`);
editElement.style.height = ''; editElement.style.height = '';
editElement.style.height = `${editElement.scrollHeight}px`; editElement.style.height = `${editElement.scrollHeight}px`;
@ -341,6 +340,7 @@
<div class=" w-full"> <div class=" w-full">
<textarea <textarea
id="message-edit-{message.id}" id="message-edit-{message.id}"
bind:this={editElement}
class=" bg-transparent outline-none w-full resize-none" class=" bg-transparent outline-none w-full resize-none"
bind:value={editedContent} bind:value={editedContent}
on:input={(e) => { on:input={(e) => {