Skip to content

Commit e138b76

Browse files
authored
1 parent 4fbb589 commit e138b76

1 file changed

Lines changed: 23 additions & 3 deletions

File tree

  • internal/view/assets/js/page

internal/view/assets/js/page/home.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,29 @@ export default {
268268
this.loadData();
269269
},
270270
changePage(page) {
271-
this.page = page;
272-
this.$refs.bookmarksGrid.scrollTop = 0;
273-
this.loadData();
271+
this.page = page;
272+
this.$nextTick(() => {
273+
const gridElement = this.$refs.bookmarksGrid;
274+
if (gridElement) {
275+
// Scrolling grid container
276+
gridElement.scrollTop = 0;
277+
// Simultaneously scroll all parent elements containing scrollbars
278+
let parent = gridElement.parentElement;
279+
while (parent && parent !== document.body) {
280+
if (parent.scrollTop !== undefined) {
281+
parent.scrollTop = 0;
282+
}
283+
parent = parent.parentElement;
284+
}
285+
}
286+
// Make sure the main container of the page also scrolls to the top
287+
const mainScene = document.getElementById('main-scene');
288+
if (mainScene && mainScene.scrollTop !== undefined) {
289+
mainScene.scrollTop = 0;
290+
}
291+
window.scrollTo(0, 0);
292+
});
293+
this.loadData();
274294
},
275295
toggleEditMode() {
276296
this.selection = [];

0 commit comments

Comments
 (0)