File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -265,6 +265,18 @@ const effectiveTotal = computed(() => {
265265 return displayResults .value .length
266266})
267267
268+ /**
269+ * Total items for pagination purposes.
270+ * Capped by EAGER_LOAD_SIZE so that the page count only reflects pages we can
271+ * actually fetch — e.g. with a 500-result cap, max pages = ceil(500 / pageSize).
272+ * Without this cap, a search returning total=92,000 would show 3,680 pages but
273+ * navigation beyond page 20 (at 25/page) would silently fail.
274+ */
275+ const paginationTotal = computed (() => {
276+ const cap = EAGER_LOAD_SIZE [searchProvider .value ]
277+ return Math .min (effectiveTotal .value , cap )
278+ })
279+
268280// Handle filter chip removal
269281function handleClearFilter(chip : FilterChip ) {
270282 clearFilter (chip )
@@ -878,7 +890,7 @@ onBeforeUnmount(() => {
878890 v-model:mode =" paginationMode"
879891 v-model:page-size =" preferredPageSize"
880892 v-model:current-page =" currentPage"
881- :total-items =" effectiveTotal "
893+ :total-items =" paginationTotal "
882894 :view-mode =" viewMode"
883895 />
884896 </div >
You can’t perform that action at this time.
0 commit comments