Skip to content

Node.js based forum software built for the modern web

added requestAnimationFrame

Barış Soner Uşaklı4b36691bbffe
diff --git a/src/views/partials/chats/message-window.tpl b/src/views/partials/chats/message-window.tpl
index 7eab83569b..ebec5013f9 100644
--- a/src/views/partials/chats/message-window.tpl
+++ b/src/views/partials/chats/message-window.tpl
@@ -31,8 +31,10 @@
(function () {
const el = document.querySelector('[component="chat/message/content"]');
if (el) {
- el.scrollTop = el.scrollHeight;
- el.classList.remove('invisible');
+ requestAnimationFrame(() => {
+ el.scrollTop = el.scrollHeight;
+ el.classList.remove('invisible');
+ });
}
})();
</script>