Skip to content

Commit

Permalink
bugfix(#534): on display number change reset to the first page (#1081)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmoesle authored Dec 6, 2023
1 parent 919c3b4 commit 09f89b5
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {useRouter} from "vue-router/composables";
import {inject, ref, Ref} from "vue";
import {usePageId} from "./pageId";
import {DEFAULT_PAGE, DEFAULT_SIZE, PageBasedPaginationProvider} from "./PageBasedPaginationProvider";
import { useRouter } from "vue-router/composables";
import { inject, ref, Ref } from "vue";
import { usePageId } from "./pageId";
import { DEFAULT_PAGE, DEFAULT_SIZE, PageBasedPaginationProvider } from "./PageBasedPaginationProvider";

interface PaginationData {
readonly searchQuery: Ref<string | undefined>;
Expand Down Expand Up @@ -69,6 +69,8 @@ export const useGetPaginationData = (): PaginationData => {
};
const setSize = (newSize: number) => {
size.value = newSize;
// reset the page to 0, because the user should see the first page after changing the size
setPage(DEFAULT_PAGE);
router.replace({
query: {
...router.currentRoute.query,
Expand Down

0 comments on commit 09f89b5

Please sign in to comment.