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) {