Merge branch 'develop' of github.com:thecodingmachine/workadventure
This commit is contained in:
commit
67d0802d1b
@ -3,7 +3,7 @@
|
|||||||
import { chatMessagesStore, chatVisibilityStore } from "../../Stores/ChatStore";
|
import { chatMessagesStore, chatVisibilityStore } from "../../Stores/ChatStore";
|
||||||
import ChatMessageForm from './ChatMessageForm.svelte';
|
import ChatMessageForm from './ChatMessageForm.svelte';
|
||||||
import ChatElement from './ChatElement.svelte';
|
import ChatElement from './ChatElement.svelte';
|
||||||
import {afterUpdate, beforeUpdate} from "svelte";
|
import {afterUpdate, beforeUpdate, onMount} from "svelte";
|
||||||
import {HtmlUtils} from "../../WebRtc/HtmlUtils";
|
import {HtmlUtils} from "../../WebRtc/HtmlUtils";
|
||||||
|
|
||||||
let listDom: HTMLElement;
|
let listDom: HTMLElement;
|
||||||
@ -15,6 +15,10 @@
|
|||||||
autoscroll = listDom && (listDom.offsetHeight + listDom.scrollTop) > (listDom.scrollHeight - 20);
|
autoscroll = listDom && (listDom.offsetHeight + listDom.scrollTop) > (listDom.scrollHeight - 20);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
listDom.scrollTo(0, listDom.scrollHeight);
|
||||||
|
})
|
||||||
|
|
||||||
afterUpdate(() => {
|
afterUpdate(() => {
|
||||||
if (autoscroll) listDom.scrollTo(0, listDom.scrollHeight);
|
if (autoscroll) listDom.scrollTo(0, listDom.scrollHeight);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user