diff --git a/frontend/src/lib/components/ModelTable/RowsPerPage.svelte b/frontend/src/lib/components/ModelTable/RowsPerPage.svelte index 8378067ef..51081847c 100644 --- a/frontend/src/lib/components/ModelTable/RowsPerPage.svelte +++ b/frontend/src/lib/components/ModelTable/RowsPerPage.svelte @@ -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)); + }