fix(theseus): Fixed scroll behavior bug (#1249)

This commit is contained in:
Norbiros 2024-07-07 22:21:07 +02:00 committed by GitHub
parent abec2e48d4
commit df76d9a50a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View File

@ -892,7 +892,6 @@ onUnmounted(() => unlistenOffline())
.search-container {
display: flex;
height: 100%; /* takes up only the necessary height */
overflow-y: auto;
scroll-behavior: smooth;

View File

@ -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
}
},
})