fix: text area height calculation in chats

This commit is contained in:
Barış Soner Uşaklı
2023-05-19 20:42:39 -04:00
parent 9e416d7fda
commit c52916de8e
2 changed files with 10 additions and 5 deletions

View File

@@ -200,7 +200,7 @@ define('forum/chats', [
textarea.on('input', function () {
const isAtBottom = messages.isAtBottom(parent.find('.chat-content'));
textarea.css({ height: 0 });
textarea.css({ height: textarea.prop('scrollHeight') + 'px' });
textarea.css({ height: messages.calcAutoTextAreaHeight(textarea) + 'px' });
if (isAtBottom) {
messages.scrollToBottom(parent.find('.chat-content'));
}