UI: Fix chat sometimes not scrolling down after sending a message

This commit is contained in:
oobabooga 2024-07-26 22:35:30 -07:00
parent c5814db173
commit 9e82f8c394

View file

@ -459,7 +459,12 @@ function updateCssProperties() {
// Adjust scrollTop based on input height change // Adjust scrollTop based on input height change
if (chatInputHeight !== currentChatInputHeight) { if (chatInputHeight !== currentChatInputHeight) {
if (!isScrolled && chatInputHeight < currentChatInputHeight) {
chatContainer.scrollTop = chatContainer.scrollHeight;
} else {
chatContainer.scrollTop += chatInputHeight - currentChatInputHeight; chatContainer.scrollTop += chatInputHeight - currentChatInputHeight;
}
currentChatInputHeight = chatInputHeight; currentChatInputHeight = chatInputHeight;
} }
} }