docs: correct the pageCount -1 note in the pagination guides - #6518
Open
dfedoryshchev wants to merge 1 commit into
Open
docs: correct the pageCount -1 note in the pagination guides#6518dfedoryshchev wants to merge 1 commit into
dfedoryshchev wants to merge 1 commit into
Conversation
The manual-pagination section says that with `pageCount: -1` both `getCanNextPage` and `getCanPreviousPage` always return `true`. Only `getCanNextPage` does. `table_getCanPreviousPage` never reads `pageCount`; it returns `pageIndex > 0`, so it is `false` on the first page whatever the page count is.
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
📝 WalkthroughWalkthroughChangesPagination documentation
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes
In the manual-pagination guide, the Page Count and Row Count section says that with
pageCount: -1bothgetCanNextPageandgetCanPreviousPage"will always returntrue". That holds forgetCanNextPageonly.table_getCanPreviousPagenever readspageCount: inrowPaginationFeature.utils.tsit isreturn (table.atoms.pagination?.get()?.pageIndex ?? 0) > 0, so it is stillfalseon page 0, and a reader following the guide would leave a "Previous" button enabled on the first page.Both JSDoc blocks in that file already describe the real behaviour, and the unit tests cover the
-1case forgetCanNextPageonly, so this is the guide prose having drifted rather than a code bug.Corrected in all 10 framework copies of the guide, which carry the sentence verbatim. Prose only.
Release Impact
Summary by CodeRabbit
pageCount: -1), next-page navigation remains enabled.