frontend: fix autoscroll breaking message loading
This commit is contained in:
parent
e267ca4fc4
commit
addfddd3ac
1 changed files with 2 additions and 3 deletions
|
@ -14,7 +14,7 @@
|
|||
|
||||
afterUpdate(() => {
|
||||
if (shouldAutoscroll && scrollTarget) {
|
||||
scrollTarget.scrollIntoView();
|
||||
scrollTarget.scrollTo(0, scrollTarget.scrollHeight);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -43,12 +43,11 @@
|
|||
}
|
||||
</style>
|
||||
|
||||
<div class="messages-container" on:scroll={ onScroll }>
|
||||
<div class="messages-container" on:scroll={ onScroll } bind:this={ scrollTarget }>
|
||||
{#each $messages as message (message.id)}
|
||||
<div>
|
||||
<b>{ message.author_username }</b>
|
||||
<span>{ message.content }</span>
|
||||
</div>
|
||||
{/each}
|
||||
<div bind:this={ scrollTarget }></div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue