From 5a5ef7564a35ec1078ba2ac4661cb12ae5e9996a Mon Sep 17 00:00:00 2001 From: tamaina Date: Mon, 17 Jul 2023 09:58:31 +0000 Subject: [PATCH] ???? --- packages/frontend/src/components/MkPagination.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/frontend/src/components/MkPagination.vue b/packages/frontend/src/components/MkPagination.vue index 924db25d0..e10d63e16 100644 --- a/packages/frontend/src/components/MkPagination.vue +++ b/packages/frontend/src/components/MkPagination.vue @@ -239,15 +239,14 @@ watch([$$(weakBacked), $$(contentEl)], () => { */ function adjustScroll(fn: () => void): Promise { const oldHeight = scrollableElement ? scrollableElement.scrollHeight : getBodyScrollHeight(); + const oldScroll = scrollableElement ? scrollableElement.scrollTop : window.scrollY; denyMoveTransition.value = true; fn(); return nextTick(() => { - const diff = (scrollableElement ? scrollableElement.scrollHeight : getBodyScrollHeight()) - oldHeight; - const newScroll = scrollableElement ? scrollableElement.scrollTop : window.scrollY; - const top = newScroll + diff; + const top = oldScroll + ((scrollableElement ? scrollableElement.scrollHeight : getBodyScrollHeight()) - oldHeight); scroll(scrollableElement, { top, behavior: 'instant' }); denyMoveTransition.value = false;