-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DataGrid] Fix autoPageSize #1366
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have logged the values of the state the current change leads to in https://codesandbox.io/s/material-demo-forked-q56bh?file=/demo.js:0-803. It logs
virtualRowsCount: 5, // The number of rows allocated for the rendered zone.
viewportPageSize: 5, // The number of rows that fit in the viewport.
renderingZonePageSize: 5, // The maximum number of rows that will be rendered at any given time in the grid.
but from how I understand the description of the state, we should have:
virtualRowsCount: 4, // The number of rows allocated for the rendered zone.
viewportPageSize: 5, // The number of rows that fit in the viewport.
renderingZonePageSize: 4, // The maximum number of rows that will be rendered at any given time in the grid.
The proposal done in #1334 (comment) goes in this direction. Considering the previous exploration done, the minimum I would have expected is the pull request description to explain why the previous proposal did wasn't flying. Instead, mentions to it. Could you expand on what are the expected values in the state? Is the current logic meant to support autoPageSize + autoHeight?
it's actually virtualRowsCount: 5, // The number of rows that are rendered at once. If pagination then it would be page size. If not, it would be the full set of rows.
viewportPageSize: 5, // The number of rows that fit in the viewport.
renderingZonePageSize: 5, // The number of rows that fit in the rendering zone. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's almost good to go.
it's actually
Ok. Could we update the documentation for each of these states? It took what was documentation and tried to find a solution based on staying true to them. e.g.
https://github.com/mui-org/material-ui-x/blob/575f10a24a3818580a16a8b6700bd50c1f6efb22/packages/grid/_modules_/grid/models/gridContainerProps.ts#L39-L42
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great
When autoPageSize is enabled, the pageSize prop value should not be used as it should be calculated according to the height of the viewport.
fix #1334