Static GitHub Issues

[3105] Preserving scroll position using alias to same route

prev: Data disappears and then re-appears, on navigation
next: Using window on server side

We use a lot of 'friendly url' params on the same page using aliases, (e.g. /posts/recent is an alias for /posts/). When these aliases are triggered with router.replace(url), savedPosition in the router's scroll behavior is null. Is there a way to preserve scroll position without adding hashes to the url and without making alias routes child routes?

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2688">#c2688</a>)</em></sub></div>