From f2c4041fcb5cb2820236f14b599c6f41abb91e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 6 Sep 2023 12:40:15 -0400 Subject: [PATCH] fix: prep edit so textarea isn't below text input --- public/src/client/chats/messages.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); }