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

Remembering scroll position #3

Open
ahdsr opened this issue Mar 24, 2022 · 0 comments
Open

Remembering scroll position #3

ahdsr opened this issue Mar 24, 2022 · 0 comments

Comments

@ahdsr
Copy link

ahdsr commented Mar 24, 2022

Hi, I'm working on a implementation using your Locomotive branch and its awesome. I've ran into a usability issue however and wanted to know if this is something you have come across before.

The issue is - I've got a long scrolling homepage, with some links situated in the middle of the page - when I click on the link, all works as expected. The page loads at top start or top of the page. When I hit the browser back button, the idea is that the user can go back to the same scroll position they left the page, but instead they are forced to the top.

Is there a way to control this behavior? I can achieve this by moving loco to the _app.js level, but this way the browser remembers the original scroll position from the first page and when navigating to other pages they are taken to the same scroll position, meaning I can't force the page to load from the top.

Any feedback is appreciated!

https://portfolio-ahdsr.vercel.app/

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

1 participant