You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(DataTable): clamp pagination when the total count shrinks - #8798
Filtering or deleting rows can leave Table.Pagination on a page greater than the new page count. Clamp the current index and persist the adjusted state so the selected page and visible bounds stay valid after the data changes.
Verification
Added a Chromium regression for shrinking from four pages to two and then to an empty table. The pagination suite passed (34 tests).
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Pagination clamping fails to notify consumers after row counts shrink, potentially leaving empty pages, and can override a simultaneous reset to index zero.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Pagination rejects valid empty-table defaults and incorrectly suppresses change notifications after clamps or batched row-count reductions, leaving pager selection and parent state inconsistent.
Starting at index 3, emptying the table and echoing the clamp as defaultPageIndex={0} leaves defaultIndex at 3 because zero is rejected when there are no pages. Requesting index 3 again before or when the rows return then goes undetected, leaving the pager on the first page. Accept index 0 as a valid empty-table default and add a regression for this sequence.
Notify parent when a page-count shrink triggers a clamp
When selecting page 2 with a stable onChange that also shrinks totalCount from 50 to 25, the pager clamps back to index 0 but only reports index 1 to the parent. The final index and existing effect dependencies are unchanged from the previous commit, so the clamp notification is skipped and the parent's row state remains out of bounds. Include pageCount in the effect dependencies and add a regression for this batched selection and shrink.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Public Table.Pagination callbacks now run post-commit and fire on automatic clamps, using heuristic echo suppression that needs maintainer review and validation against server-paginated consumers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Filtering or deleting rows can leave Table.Pagination on a page greater than the new page count. Clamp the current index and persist the adjusted state so the selected page and visible bounds stay valid after the data changes.
Verification
Added a Chromium regression for shrinking from four pages to two and then to an empty table. The pagination suite passed (34 tests).