This commit is contained in:
retoor 2025-06-25 18:07:11 +02:00
parent 3130933ea4
commit 934f334b91

View File

@ -59,12 +59,13 @@ class MessageList extends HTMLElement {
return this.isElementVisible(this.querySelector(".message-list-bottom"));
}
scrollToBottom(force) {
this.scrollTop = this.scrollHeight;
//this.scrollTop = this.scrollHeight;
this.querySelector(".message-list-bottom").scrollIntoView();
this.querySelector(".message-list-bottom").scrollIntoView();
setTimeout(() => {
this.scrollTop = this.scrollHeight;
// this.scrollTop = this.scrollHeight;
this.querySelector(".message-list-bottom").scrollIntoView();
},200)
}
@ -80,7 +81,7 @@ class MessageList extends HTMLElement {
const html = receivedHtml.querySelector(".text").innerHTML;
const textElement = messageDiv.querySelector(".text");
textElement.innerHTML = html;
messageDiv.style.display = message.text == "" ? "none" : "block";
textElement.style.display = message.text == "" ? "none" : "block";
if(scrollToBottom)
this.scrollToBottom(true)
}