-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Description
- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
<TablePagination count={-1} page={0} rowsPerPage={10} />The count={-1} should, per the documentation, indicate that the total count is unknown as we are (probably) using server-side pagination.
I therefore expect to be able to use the next/previous page toggles (excepting previous when on page 1), without the component attempting to enforce an acceptable page range (as it has no way of knowing what that is).
When the count={-1} prop is present, and the page prop changes to anything other than 0, the following warning appears in the console:
Warning: Failed prop type: Material-UI: the page prop of a TablePagination is out of range (0 to 0, but page is 1).
And despite purporting to be a warning, which I could somewhat tolerate, this is actually emitted as an error in the console.
Expected Behavior 🤔
When count={-1}, changing the page of the TablePagination should not emit this warning/error.
Steps to Reproduce 🕹
https://codesandbox.io/s/smoosh-cdn-ov0gg
Steps:
- Visit the Code Sandbox.
- Simply click the pagination next/previous page buttons and observe the console errors occuring.
Your Environment 🌎
Material UI v4.9.4