try to hotfix the not autofocus

This commit is contained in:
Julien Calixte
2023-12-28 11:04:04 +01:00
parent 69fd413224
commit 9f0e6007a2
2 changed files with 14 additions and 20 deletions

View File

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