diff --git a/packages/frontend-core/src/components/grid/stores/pagination.js b/packages/frontend-core/src/components/grid/stores/pagination.js index 1dbea6e0d2..f4fdee2ff4 100644 --- a/packages/frontend-core/src/components/grid/stores/pagination.js +++ b/packages/frontend-core/src/components/grid/stores/pagination.js @@ -15,8 +15,14 @@ export const initialise = context => { ) // Fetch next page when fewer than 25 remaining rows to scroll - remainingRows.subscribe(remaining => { - if (remaining < 25 && get(rowCount)) { + const needsNewPage = derived( + [remainingRows, rowCount], + ([$remainingRows, $rowCount]) => { + return $remainingRows < 25 && $rowCount + } + ) + needsNewPage.subscribe($needsNewPage => { + if ($needsNewPage) { rows.actions.loadNextPage() } })