Skip to content

Commit 55770d6

Browse files
committed
Fix scrolling when expanding assets or item assets radiantearth#537
1 parent eddcc2c commit 55770d6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/StacBrowser.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,15 @@ const router = new VueRouter({
6666
mode: CONFIG.historyMode,
6767
base: CONFIG.pathPrefix,
6868
routes: getRoutes(CONFIG),
69-
scrollBehavior: () => ({ x: 0, y: 0 })
69+
scrollBehavior: (to, from, savedPosition) => {
70+
console.log(to, from);
71+
if (to.path !== from.path) {
72+
return { x: 0, y: 0 };
73+
}
74+
else {
75+
return savedPosition;
76+
}
77+
}
7078
});
7179
7280
// Setup store

0 commit comments

Comments
 (0)