From 57822b23cb68a3226ad7bcede219cf8e39452c9b Mon Sep 17 00:00:00 2001 From: Jan Fooken Date: Wed, 31 Jul 2024 14:40:44 +0200 Subject: [PATCH] Fix edge case Thanks Alessio <3 --- assets/js/common/Table/Pagination.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/js/common/Table/Pagination.jsx b/assets/js/common/Table/Pagination.jsx index 16ad83b0fa..b2bf08f6e7 100644 --- a/assets/js/common/Table/Pagination.jsx +++ b/assets/js/common/Table/Pagination.jsx @@ -19,7 +19,9 @@ function Pagination({ // Can happen if the items per page get changed, while being on the last // page if (currentPage > pages) { - onSelect(pages); + // "what if pages is 0?" + // otherwise the user is always staying at page 0 + onSelect(pages || 1); } return (