-
-
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
Window isn't scrolled to top when transitioning to the same route with a new query string #189
Comments
Regarding the match check, on initial render of the route handlers you don't have a match, so that check needs to be there.
@thomasboyt thoughts on how to appropriately opt in/out? |
Definitely can see cases for both of this: pagination being an example of when I would want it to scroll and a photo gallery being an example of when I wouldn't. Should |
[fixed] Initial render to null causing second render [fixed] Query not passed to willTransitionTo [fixed] ActiveState mixin causing second render [added] Docs [added] Tests ```js Router.renderRoutesToString(routes, originalUrl).then(function (data) { data.html; //string returned from React.renderComponentToString }).catch(function (error){ //Redirect will set error.status and error.location error.status; //302 for Redirect error.location; //location to redirect to });
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
If you transition from a route to the same route with a new query,
window.scrollTo
doesn't get called.This is due to this line: https://github.com/rackt/react-router/blob/master/modules/components/Routes.js#L447 -
match
is undefined when transitioning to the same route. Removing that check fixes the issue, but I feel like it's likely there for a reason, so I don't just want to submit a PR deleting it ;)The text was updated successfully, but these errors were encountered: