When totalRowsCount is 0 the paginator rendered 1-0 of 0 items and of 0 pages, with the next button still enabled because pageIndex (1) !== maxIndex (0).
This is visible on any empty list that uses PaginatorComponent. It's most obvious right now under the new Flow Activity panel (PR #12932), but the bug pre-dates that work.
Changes
Hide the range when empty and render 0 items (or 0 flows / 0 components depending on isComponent)
Floor maxIndex to 1 so the page selector reads of 1 pages instead of of 0 pages
Switch disableLastPage from === to >= so both prev and next are disabled when there is nowhere to go
Add PaginatorComponent.test.tsx covering empty-state labels, range clamping, page count, and prev/next button enablement (12 tests)
Screenshot context
Before: 1-0 of 0 items / of 0 pages / next button enabled
After: 0 items / of 1 pages / both nav buttons disabled
CUT
cutterbot commented just now
Cutter Summary
The empty-state paginator bar previously rendered a "-19-0 of 0 items" range with the next-page control active, and now displays a single "0 items" label.
Summary
When
totalRowsCountis 0 the paginator rendered1-0 of 0 itemsandof 0 pages, with the next button still enabled becausepageIndex (1) !== maxIndex (0).This is visible on any empty list that uses
PaginatorComponent. It's most obvious right now under the new Flow Activity panel (PR #12932), but the bug pre-dates that work.Changes
0 items(or0 flows/0 componentsdepending onisComponent)maxIndexto 1 so the page selector readsof 1 pagesinstead ofof 0 pagesdisableLastPagefrom===to>=so both prev and next are disabled when there is nowhere to goPaginatorComponent.test.tsxcovering empty-state labels, range clamping, page count, and prev/next button enablement (12 tests)Screenshot context
Before:
1-0 of 0 items/of 0 pages/ next button enabled After:0 items/of 1 pages/ both nav buttons disabled