Skip to content

Commit

Permalink
fix(router): api for scrollBehaviour changed (x, y -> left, top)
Browse files Browse the repository at this point in the history
  • Loading branch information
bludnic committed May 9, 2024
1 parent 701b83f commit 5f73db1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const routes = [
requiresAuth: false,
layout: 'no-container',
scrollPosition: {
x: 0,
y: 0
left: 0,
top: 0
}
}
},
Expand All @@ -53,8 +53,8 @@ const routes = [
requiresAuth: true,
layout: 'no-container',
scrollPosition: {
x: 0,
y: 0
left: 0,
top: 0
}
}
},
Expand Down Expand Up @@ -103,8 +103,8 @@ const routes = [
layout: 'no-container',
showNavigation: true,
scrollPosition: {
x: 0,
y: 0
left: 0,
top: 0
}
}
},
Expand All @@ -130,8 +130,8 @@ const routes = [
containerNoPadding: true,
showNavigation: true,
scrollPosition: {
x: 0,
y: 0
left: 0,
top: 0
}
}
},
Expand Down Expand Up @@ -183,11 +183,11 @@ const router = createRouter({
scrollBehavior(to, from, savedPosition) {
if (to.params.txId) {
// Don't restore scroll for Transaction details screen
return { x: 0, y: 0 }
return { left: 0, top: 0 }
} else if (savedPosition) {
return savedPosition
} else if (to.meta.scrollPosition) {
return window.scrollTo(to.meta.scrollPosition.x, to.meta.scrollPosition.y)
return to.meta.scrollPosition
}
}
})
Expand Down

0 comments on commit 5f73db1

Please sign in to comment.