diff --git a/static/js/components/chat.js b/static/js/components/chat.js index ad876ad..847d64a 100644 --- a/static/js/components/chat.js +++ b/static/js/components/chat.js @@ -12,6 +12,7 @@ const runChat = async () => { const scrollTopMax = scrollHeight - clientTop; const isAtEdge = scrollTop > (0.92 * scrollTopMax) || scrollTop === 0; document.getElementById("messages").innerHTML = html; + await new Promise((res) => setTimeout(res, 200)); // wait for html to emplace. if (!document.getElementById("chat-container")) return; const emplacedScrollTopMax = document.getElementById("chat-container").scrollHeight - document.getElementById("chat-container").clientTop; if (isAtEdge) {