diff --git a/src/Interactivity/Moments/Pagination/PaginationDefaultComponentCreator.cs b/src/Interactivity/Moments/Pagination/PaginationDefaultComponentCreator.cs index 94fceba..e3b1287 100644 --- a/src/Interactivity/Moments/Pagination/PaginationDefaultComponentCreator.cs +++ b/src/Interactivity/Moments/Pagination/PaginationDefaultComponentCreator.cs @@ -83,7 +83,7 @@ private static int CalculatePageCount(int startingIndex, int totalPageCount) if (startingIndex == 0) { // Return 24 so that the "Next Section" button is added. - return totalPageCount > 25 ? 24 : 25; + return totalPageCount > 25 ? 24 : Math.Min(24, totalPageCount); } // Return 23 so that the "Previous Section" and "Next Section" buttons are added.