From 9e82f8c3943511b27fcbdbf317bc1b68623d3071 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Fri, 26 Jul 2024 22:35:30 -0700 Subject: [PATCH] UI: Fix chat sometimes not scrolling down after sending a message --- js/main.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index 3b8b13e4..d5287482 100644 --- a/js/main.js +++ b/js/main.js @@ -459,7 +459,12 @@ function updateCssProperties() { // Adjust scrollTop based on input height change if (chatInputHeight !== currentChatInputHeight) { - chatContainer.scrollTop += chatInputHeight - currentChatInputHeight; + if (!isScrolled && chatInputHeight < currentChatInputHeight) { + chatContainer.scrollTop = chatContainer.scrollHeight; + } else { + chatContainer.scrollTop += chatInputHeight - currentChatInputHeight; + } + currentChatInputHeight = chatInputHeight; } }