New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smooth scrolling does not work in firefox but does in chrome #1411
Labels
browser quirk
Specific to a browser
bug
Something isn't working
has workaround
A workaround has been found to deal with the issue
Comments
hmm, this is weird, it could be a Firefox regression similar to #1147. It would require checking which version broke and why: At least there is a very easy workaround: delay one tick the resolution of the scrollBehavior: const delay = (t) => new Promise((r) => setTimeout(r, t))
const router = createRouter({
history: createWebHashHistory(),
// history: createWebHistory(),
routes,
async scrollBehavior(to, from, savedPosition) {
console.log({ savedPosition })
if (savedPosition) {
return savedPosition
} else {
await delay(0)
return { top: 0, behavior: 'smooth' }
}
},
}) |
posva
added
bug
Something isn't working
has workaround
A workaround has been found to deal with the issue
browser quirk
Specific to a browser
labels
May 20, 2022
Thanks a lot for the workaround. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
browser quirk
Specific to a browser
bug
Something isn't working
has workaround
A workaround has been found to deal with the issue
Version
4.0.15
Reproduction link
github.com
Steps to reproduce
Run the reproduction scroll down and press the
link
titled link.What is expected?
It is expected that the current page is changed to the
test
page and is smoothly scrolled to the top.What is actually happening?
In firefox the current page switches to the
test
page, but does not scroll up.Works in chrome. Removing the
behavior: 'smooth'
makes thetest
page at least start on top, but also removes the intended scroll effect.The text was updated successfully, but these errors were encountered: