Fix weird scroll position bug

This commit is contained in:
Jonathan Staab 2023-07-07 14:26:08 -07:00
parent cb2cefa5ba
commit 741e249827

View File

@ -78,8 +78,13 @@
document.body.style.position = `fixed`
}
} else if (!isNil(scrollY)) {
document.body.setAttribute("style", "")
window.scrollTo(0, scrollY)
const offset = scrollY
// I don't know why this timeout is necessary
setTimeout(() => {
document.body.setAttribute("style", "")
window.scrollTo(0, offset)
}, 100)
scrollY = null
}