diff --git a/public/src/client/chats/messages.js b/public/src/client/chats/messages.js index 88e03bf4bc..17c85abb37 100644 --- a/public/src/client/chats/messages.js +++ b/public/src/client/chats/messages.js @@ -198,6 +198,7 @@ define('forum/chats/messages', [ const messageControls = msgEl.find(`[component="chat/message/controls"]`); const chatContent = messageBody.parents('[component="chat/message/content"]'); + const isAtBottom = messages.isAtBottom(chatContent); messageBody.addClass('hidden'); messageControls.addClass('hidden'); editEl.insertAfter(messageBody); @@ -207,7 +208,7 @@ define('forum/chats/messages', [ textarea.focus().putCursorAtEnd(); autoresizeTextArea(textarea); - if (chatContent.length && messages.isAtBottom(chatContent)) { + if (chatContent.length && isAtBottom) { messages.scrollToBottom(chatContent); }