Skip to content

Remembering scroll position #3

Open

Description

@ahdsr

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/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions