-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
preserve scroll position on "back" #186
Comments
as mentioned: #129 (comment) |
👍 |
How many levels of "back" do we want to support? I've experimented a little using Chrome, and it seems like it remembers a lot of history. e.g. I can get 10 pages deep and every time I click back the scroll position for that page is preserved. |
ALL OF THEM |
Seriously though, the only constraint is the memory used by holding onto an array of small integers, which I can't imagine ever really matters. We'd need to do the same with forward too I guess. |
The problem I've seen with the browser maintained scroll position and SPA apps is the browser tries to move you to its remembered scroll position almost immediately after clicking back. So for long lists/tables (anything that takes a while to render) the browser scrolling fails as it scrolls you before the page is rendered. |
Browsing around the React source this morning, I came across |
I don't think that's related and it's certainly not part of the current public API. |
The router now remembers the last window scroll position at various paths and automatically scrolls the window to match after transitions complete unless preserveScrollPosition=true is used. This commit also introduces a flux-style architecture to the high-level transitionTo/replaceWith/goBack methods. Fixes #189 Fixes #186
I think only half side of the issue is closed. Here is the other side that is still an issue: Suppose I have a page |
@greenlaw110 I have the same issue. Did you find a solution to this? |
@arunkjn sorry it was long time ago. I can't remember clearly but I don't think it is resolved. |
The new auto-scrolling feature is fantastic, but traditionally when you click "back" in a website the browser remembers the scroll position.
We should too.
The text was updated successfully, but these errors were encountered: