From 934f334b91e6398660fd0df7adbe73b6f4e77c84 Mon Sep 17 00:00:00 2001 From: retoor Date: Wed, 25 Jun 2025 18:07:11 +0200 Subject: [PATCH] Upodate. --- src/snek/static/message-list.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/snek/static/message-list.js b/src/snek/static/message-list.js index d80f7b9..1a4c895 100644 --- a/src/snek/static/message-list.js +++ b/src/snek/static/message-list.js @@ -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) }