[TablePagination] Out of range warning when "count={-1}" #19865
Labels
bug 🐛
Something doesn't work
component: table
This is the name of the generic UI component, not the React module!
good first issue
Great for first contributions. Enable to learn the contribution process.
Current Behavior 😯
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 thepage
prop changes to anything other than0
, 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 theTablePagination
should not emit this warning/error.Steps to Reproduce 🕹
https://codesandbox.io/s/smoosh-cdn-ov0gg
Steps:
Your Environment 🌎
Material UI v4.9.4
The text was updated successfully, but these errors were encountered: