We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 507be8c commit 8bc8543Copy full SHA for 8bc8543
1 file changed
app/router.options.ts
@@ -1,7 +1,7 @@
1
import type { RouterConfig } from 'nuxt/schema'
2
3
export default {
4
- scrollBehavior(to, _from, savedPosition) {
+ scrollBehavior(to, from, savedPosition) {
5
// If the browser has a saved position (e.g. back/forward navigation), restore it
6
7
if (savedPosition) {
@@ -11,8 +11,8 @@ export default {
11
// Preserve the current viewport for query-only updates on pages that opt in,
12
// such as compare where controls sync state to the URL in-place.
13
if (
14
- to.path === _from.path &&
15
- to.hash === _from.hash &&
+ to.path === from.path &&
+ to.hash === from.hash &&
16
to.meta.preserveScrollOnQuery === true
17
) {
18
return false
0 commit comments