aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/views
diff options
context:
space:
mode:
authorJan <sentrycraft123@gmail.com>2023-07-02 15:55:57 +0100
committerGitHub <noreply@github.com>2023-07-02 16:55:57 +0200
commit80ec31fa92370472a442a43de993d7a6ce79741a (patch)
tree94706f9b0c958b8e8b203ebbc912e5020e95cc88 /src-vue/src/views
parent46260b91481a7d5378f5ea6a32692774cb7037dd (diff)
downloadFlightCore-80ec31fa92370472a442a43de993d7a6ce79741a.tar.gz
FlightCore-80ec31fa92370472a442a43de993d7a6ce79741a.zip
fix: delay scrolling the Mods View to prevent it stopping prematurely (#403)
Diffstat (limited to 'src-vue/src/views')
-rw-r--r--src-vue/src/views/mods/ThunderstoreModsView.vue13
1 files changed, 9 insertions, 4 deletions
diff --git a/src-vue/src/views/mods/ThunderstoreModsView.vue b/src-vue/src/views/mods/ThunderstoreModsView.vue
index 7f70f03c..1221f85f 100644
--- a/src-vue/src/views/mods/ThunderstoreModsView.vue
+++ b/src-vue/src/views/mods/ThunderstoreModsView.vue
@@ -18,7 +18,7 @@
layout="prev, pager, next"
:page-size="modsPerPage"
:total="modsList.length"
- @current-change="(e: number) => currentPageIndex = e - 1"
+ @update:current-page="onPaginationChange"
/>
</div>
@@ -36,7 +36,8 @@
layout="prev, pager, next"
:page-size="modsPerPage"
:total="modsList.length"
- @current-change="onBottomPaginationChange"
+ @update:current-page="onPaginationChange"
+ @current-change="scrollTop"
/>
</div>
</div>
@@ -183,9 +184,13 @@ export default defineComponent({
/**
* This updates current pagination and scrolls view to the top.
*/
- onBottomPaginationChange(index: number) {
+ onPaginationChange(index: number) {
this.currentPageIndex = index - 1;
- (this.$refs.scrollbar as ScrollbarInstance).scrollTo({ top: 0, behavior: 'smooth' });
+ },
+ scrollTop(index: number) {
+ setTimeout(() => {
+ (this.$refs.scrollbar as ScrollbarInstance).scrollTo({ top: 0, behavior: 'smooth' });
+ }, 100)
}
},
watch: {