useScrollRestoration only supports vertical scroll #35237
Unanswered
magnusarinell
asked this question in
Ideas / Feature Requests
Replies: 0 comments
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.
-
I wanted to use the useScrollRestoration hook to keep scroll state for a horizontal tab component. The hook however only records vertical scroll and restores that. I hackishly solved my issue by copying and modifying the related code, saving the scrollLeft value and doing scrollTo using the x position. Something like:
It would be nice with support for horizontal scroll restoration in the useScrollRestoration hook.
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions