Skip to content

Commit

Permalink
Fix pagination overlow when changing the number of rows per page by a…
Browse files Browse the repository at this point in the history
… bigger value
  • Loading branch information
monsieurswag committed Apr 17, 2024
1 parent 7d739cd commit a6632b7
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 a6632b7

Please sign in to comment.