Replies: 1 comment
-
+1 Alternatively, is there a way to detect the navigation event and temporarily disable the smooth scroll style when it occurs? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I use
scroll-behavior: smooth
for smooth scrolling on anchor click. The problem is that it smooths the scroll restoration on page navigation too. This occurs because<ScrollRestoration />
internally doesn't provide any value foroptions.behavior
when callingscrollTo()
, which relies on the value ofscroll-behavior
by default.Wouldn't it be better if the
"instant"
behavior was enforced in<ScrollRestoration />
? I don't see why anyone would want to see the entire new page scrolled from bottom to top with every navigation.Or, at the very least, we need a prop to customize the behavior:
Ready to do a PR if you're okay with it.
Beta Was this translation helpful? Give feedback.
All reactions