Preserve cursor and selection across reloads.

This commit is contained in:
Leo Vasanko
2023-11-20 14:49:15 -08:00
parent 8592d462f2
commit 52beedcef0
3 changed files with 16 additions and 10 deletions
+1 -6
View File
@@ -164,15 +164,10 @@ watchEffect(() => {
focusBreadcrumb()
}
})
let nowkey = ref(0)
let modifiedTimer: any = null
const updateModified = () => {
nowkey.value = Math.floor(Date.now() / 1000)
}
onMounted(() => {
const active = document.querySelector('.cursor') as HTMLElement | null
if (active) {
active.scrollIntoView({ block: 'center', behavior: 'smooth' })
active.scrollIntoView({ block: 'center', behavior: 'instant' })
active.focus()
}
})