From 319b90ea5587b65c0f405db4fd0f6974de103ea0 Mon Sep 17 00:00:00 2001 From: flashwave Date: Thu, 27 Jun 2024 18:44:12 +0000 Subject: [PATCH] Fixes for input box growing. --- src/mami.js/ui/hooks.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mami.js/ui/hooks.js b/src/mami.js/ui/hooks.js index 6e5d072..7477c29 100644 --- a/src/mami.js/ui/hooks.js +++ b/src/mami.js/ui/hooks.js @@ -51,7 +51,9 @@ Umi.UI.Hooks = (function() { } }); - msgText.addEventListener('input', function(ev) { + msgText.addEventListener('keyup', function(ev) { + const isScrolledToBottom = Umi.UI.Messages.IsScrolledToBottom(); + const elemParent = msgText.parentNode; let height = 40; @@ -62,6 +64,9 @@ Umi.UI.Hooks = (function() { elemParent.style.height = height.toString() + 'px'; else elemParent.style.height = null; + + if(isScrolledToBottom) + Umi.UI.Messages.ScrollIfNeeded(); }); msgText.addEventListener('keydown', function(ev) {