Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(app): restore scroll to top when changing desktop routes (#15995)
Seemingly after React Router migration from v5->v6, the window retains its scroll position even after changing routes. We would expect scroll position to renew to the top of the window when changing routes, as the `Route` component is updated. To force this, I pass a key to the `React.Fragment` supplied as the `element` prop within each mapped `Route`, following the API. This seems to be related to a [separate top-level routing issue](#15875) on the ODD and should be investigated further after release. Interestingly, React Router provides an explicit [`ScrollRestoration`](https://reactrouter.com/en/main/components/scroll-restoration`) component that is meant to be used to achieve the behavior that we are seeing now, maintaining scroll position between routes, so I would think that excluding this component would result in scroll returning to the top by default. Closes RQA-2953
- Loading branch information