Skip to content

Commit

Permalink
fix(theseus): Fixed scroll behavior bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Norbiros committed Jul 7, 2024
1 parent abec2e4 commit 3364906
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion apps/app/src/pages/Browse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,6 @@ onUnmounted(() => unlistenOffline())
.search-container {
display: flex;
height: 100%; /* takes up only the necessary height */
overflow-y: auto;
scroll-behavior: smooth;
Expand Down
8 changes: 6 additions & 2 deletions apps/app/src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ export default new createRouter({
linkActiveClass: 'router-link-active',
linkExactActiveClass: 'router-link-exact-active',
scrollBehavior() {
// always scroll to top
return { top: 0 }
// Sometimes Vue's scroll behavior is not working as expected, so we need to manually scroll to top (especially on Linux)
document.querySelector(".router-view").scrollTop = 0;
return {
el: ".router-view",
top: 0
}
},
})

0 comments on commit 3364906

Please sign in to comment.