Skip to content

Commit

Permalink
Merge pull request #276 from intuitem/CA-368-Fix-pagination-overflow-…
Browse files Browse the repository at this point in the history
…when-changing-the-number-of-object-per-page-by-a-bigger-value

Fix pagination overlow when changing the number of rows per page by a bigger value
  • Loading branch information
eric-intuitem authored Apr 17, 2024
2 parents 8452ec8 + a6632b7 commit 78850dd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frontend/src/lib/components/ModelTable/RowsPerPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
import * as m from '$paraglide/messages';
export let handler: DataHandler;
const rowsPerPage = handler.getRowsPerPage();
const rowCount = handler.getRowCount();
const options = [5, 10, 20, 50, 100];
$: if ($rowCount.start >= $rowCount.total && $rowsPerPage) {
handler.setPage(Math.ceil($rowCount.total / $rowsPerPage));
}
</script>

<aside class="flex items-center">
Expand Down

0 comments on commit 78850dd

Please sign in to comment.