mirror of
https://github.com/open-webui/open-webui.git
synced 2026-02-24 04:00:31 +01:00
feat: scroll to rich ui once rendered (#21698)
* Update Chat.svelte * Update Chat.svelte
This commit is contained in:
@@ -427,6 +427,15 @@
|
||||
message.files = data.files;
|
||||
} else if (type === 'chat:message:embeds' || type === 'embeds') {
|
||||
message.embeds = data.embeds;
|
||||
|
||||
// Auto-scroll to the embed once it's rendered in the DOM
|
||||
await tick();
|
||||
setTimeout(() => {
|
||||
const embedEl = document.getElementById(`${event.message_id}-embeds-0`);
|
||||
if (embedEl) {
|
||||
embedEl.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}, 100);
|
||||
} else if (type === 'chat:message:error') {
|
||||
message.error = data.error;
|
||||
} else if (type === 'chat:message:follow_ups') {
|
||||
|
||||
Reference in New Issue
Block a user