🐛 (focus) wait 100 for first stacked note

This commit is contained in:
2021-04-10 12:33:44 +02:00
parent 896d0233c5
commit 35503601f3
2 changed files with 22 additions and 10 deletions

View File

@@ -25,15 +25,25 @@ export const useOverlay = (listen = true) => {
)
}
const scrollToNote = (to: number) => {
if (isMobile.value) {
body.scroll({
top: to
})
const scrollToNote = (to: number, wait = false) => {
const go = () => {
if (isMobile.value) {
body.scroll({
top: to
})
} else {
body.scroll({
left: to
})
}
}
if (wait) {
setTimeout(() => {
go()
}, 100)
} else {
body.scroll({
left: to
})
go()
}
}