Make more robust

This commit is contained in:
Niek van der Maas 2023-03-22 09:40:25 +01:00
parent 8865b5095d
commit 1cea77fbb8
2 changed files with 2 additions and 3 deletions

View File

@ -26,7 +26,7 @@
<div class="column is-one-fifth">
<Sidebar bind:apiKey bind:sortedChats />
</div>
<div class="column is-four-fifths">
<div class="column is-four-fifths" id="content">
{#key $location}
<Router {routes} />
{/key}

View File

@ -162,8 +162,7 @@
// Scroll to the bottom of the chat on update
afterUpdate(() => {
// Scroll to the bottom of the page after any updates to the messages array
const chatWindow = document.getElementsByClassName('column is-four-fifths')[0]
chatWindow.scrollIntoView({ behavior: 'smooth', block: 'end' })
document.querySelector('#content')?.scrollIntoView({ behavior: 'smooth', block: 'end' })
input.focus()
})