{"action":"created","issue":{"url":"https://api.github.com/repos/rackt/react-router/issues/810","labels_url":"https://api.github.com/repos/rackt/react-router/issues/810/labels{/name}","comments_url":"https://api.github.com/repos/rackt/react-router/issues/810/comments","events_url":"https://api.github.com/repos/rackt/react-router/issues/810/events","html_url":"https://github.com/rackt/react-router/issues/810","id":57215078,"number":810,"title":"Controlling scroll behavior when clicking a <Link>","user":{"login":"MadLittleMods","id":558581,"avatar_url":"https://avatars.githubusercontent.com/u/558581?v=3","gravatar_id":"","url":"https://api.github.com/users/MadLittleMods","html_url":"https://github.com/MadLittleMods","followers_url":"https://api.github.com/users/MadLittleMods/followers","following_url":"https://api.github.com/users/MadLittleMods/following{/other_user}","gists_url":"https://api.github.com/users/MadLittleMods/gists{/gist_id}","starred_url":"https://api.github.com/users/MadLittleMods/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MadLittleMods/subscriptions","organizations_url":"https://api.github.com/users/MadLittleMods/orgs","repos_url":"https://api.github.com/users/MadLittleMods/repos","events_url":"https://api.github.com/users/MadLittleMods/events{/privacy}","received_events_url":"https://api.github.com/users/MadLittleMods/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-10T18:28:10Z","updated_at":"2015-02-12T14:57:44Z","closed_at":null,"body":"I am trying to use [`Route.ignoreScrollBehavior`](https://github.com/rackt/react-router/blob/master/docs/api/components/Route.md#ignorescrollbehavior) on each route to stop the jump-to-top effect when clicking a [`<Link>`](https://github.com/rackt/react-router/blob/master/docs/api/components/Link.md) element. But it doesn't seem to do anything because on each page change, the scroll position moves to the top.\r\n\r\n[Full snippet here](https://gist.github.com/anonymous/d18e7de5454cf478e95c)\r\n[`Route.ignoreScrollBehavior`](https://github.com/rackt/react-router/blob/master/docs/api/components/Route.md#ignorescrollbehavior)\r\n```\r\n<Route name=\"all\" handler={TodoApp} ignoreScrollBehavior />\r\n```\r\n\r\nTried this from something I saw in the [changelog](https://github.com/rackt/react-router/blob/master/CHANGELOG.md#v093---wed-08-oct-2014-144452-gmt)\r\n\r\n```\r\n<Route name=\"all\" handler={TodoApp}  scrollBehaviour=\"none\" />\r\n```\r\n\r\n---\r\n\r\nI tried setting the [`scrollBehaviour` in `Router.create`](https://github.com/rackt/react-router/blob/master/docs/api/create.md#scrollbehavior) but that doesn't seem to do anything. I also found this confusing because the documentation isn't clear on what to set the value as. \r\n\r\nI found [some documentation](https://github.com/rackt/react-router/blob/master/UPGRADE_GUIDE.md#preservescrollposition---scrollbehavior) saying you can use strings. I assume this is actually for adding the `scrollBehaviour` property to a `<Route>` itself which is deprecated and removed. Strings don't work anyway because it complains about it not having a `updateScrollPosition` property.\r\n\r\n - 'browser'\r\n - 'scrollToTop'\r\n - 'none'\r\n\r\nI assume that it wants to use the [modules/behaviors](https://github.com/rackt/react-router/tree/master/modules/behaviors) that are exported. In the tests, the behaviours are used.\r\n\r\n```\r\nvar { ImitateBrowserBehavior, ScrollToTopBehavior } = Router;\r\n\r\nRouter.create({\r\n\troutes: routes,\r\n\tscrollBehaviour: ImitateBrowserBehavio // or `ScrollToTopBehavior`\r\n});\r\n```\r\n\r\nRelated to issue #432."},"comment":{"url":"https://api.github.com/repos/rackt/react-router/issues/comments/74083840","html_url":"https://github.com/rackt/react-router/issues/810#issuecomment-74083840","issue_url":"https://api.github.com/repos/rackt/react-router/issues/810","id":74083840,"user":{"login":"gaearon","id":810438,"avatar_url":"https://avatars.githubusercontent.com/u/810438?v=3","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"created_at":"2015-02-12T14:57:44Z","updated_at":"2015-02-12T14:57:44Z","body":"As far as I can see, this is your problem: https://github.com/MadLittleMods/react-flux-todomvc/blob/master/js/app.js#L13\r\n\r\nEach time you switch filter, you render a different class.\r\nReact bails out of reconciliation in this case and throws away the DOM: http://facebook.github.io/react/docs/reconciliation.html#different-node-types\r\n\r\nYou can probably change it to always use `TodoApp` and instead tweak `render`:\r\n\r\n```js\r\nrun(function (Handler, state) {\r\n        var lastRoute = state.routes[state.routes.length - 1];\r\n\tReact.render(<Handler filter={lastRoute.name} />, document.getElementById('todoapp'));\r\n})\r\n```"}}