mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-01 19:50:41 +02:00
fix: scroll to the top of a chat on the first click of Scroll to Top (#28659)
This commit is contained in:
@@ -159,12 +159,17 @@
|
||||
messagesCount = null;
|
||||
buildMessages();
|
||||
await tick();
|
||||
if (messages.length > 0) {
|
||||
const firstMessageEl = document.getElementById(`message-${messages[0].id}`);
|
||||
if (firstMessageEl) {
|
||||
firstMessageEl.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||
}
|
||||
}
|
||||
|
||||
const element = getMessagesContainer();
|
||||
if (!element) return;
|
||||
|
||||
element.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
requestAnimationFrame(() => {
|
||||
element.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
requestAnimationFrame(() => {
|
||||
element.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const updateChat = async () => {
|
||||
|
||||
Reference in New Issue
Block a user