Force instant scrolling in scroll restoration #10328
david-bezero
started this conversation in
Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently if a page uses
ScrollRestoration
and has the following CSS:then the page will appear to jump around in a non-intuitive way when switching to a new page (specifically: it will show the current scroll position on the new page, then animate to the correct scroll position). Having this global smooth scrolling behaviour can be desirable in some cases (e.g. within large pages with internal anchor links), but is never desirable when switching between pages.
I propose changing
ScrollRestoration
to force immediate scrolling (see #10318 for details)On that PR, it was suggested that an alternative approach might be to make the
scrollTo
function into customisable parameter. This would also enable solving the issue, but since the default behaviour would continue to be surprising in this scenario, it puts the burden on every user individually to fix it.Beta Was this translation helpful? Give feedback.
All reactions