Skip to content
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

Check the new scroll restoration feature in Next.js #3

Open
satazor opened this issue Aug 4, 2020 · 2 comments
Open

Check the new scroll restoration feature in Next.js #3

satazor opened this issue Aug 4, 2020 · 2 comments

Comments

@satazor
Copy link
Contributor

satazor commented Aug 4, 2020

https://github.com/vercel/next.js/pull/13914/files#diff-5eff10c96fa6858c659318492c4cf7f7

It seems that the X and Y coordinates are being stored in the router state, meaning perhaps we can leverage those instead of saving into the local storage.

@meotimdihia
Copy link

meotimdihia commented Feb 8, 2021

Currently, next-router-scroll spam this message when a user disabled localStorage:

SecurityError: Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document.
If the user disables Local Storage, this message will be spam in the browser console.

And it sent a lot of logs to my sentry.
If the feature is implemented. it will fix this problem.

@RainGrid
Copy link

RainGrid commented Dec 1, 2022

@satazor they have already discarded the idea to persist scroll in the router state. Also the built-in solution doesnt provide any control of when we need to restore and in what cases, as well as the ability to persist the scroll of any element. We still need this library :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants