DataViews: Introduce perPageSizes to control the available sizes of the items per page#70604
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| titleField: 'title', | ||
| descriptionField: 'description', | ||
| mediaField: 'image', | ||
| perPageSizes: [ 3, 6, 12, 24 ], |
There was a problem hiding this comment.
I'm thinking that this is not really a "view" configuration but more a prop of DataViews no?
There was a problem hiding this comment.
But we already have a perPage view config—wouldn't it be better to bundle them together?
There was a problem hiding this comment.
There's an important difference IMO. perPage impacts the layout itself, what is being rendered. So it's really the config of the "view". perPageSizes is more about the "form" that is used to configure the view, not the view itself.
There was a problem hiding this comment.
Ok. Changed to the props of the DataViews via 48a1e90 🙂
| - Add `label-position-side` classes to labels in the form field layouts. Ensure that labels in the panel view do not align center, and that all side labels are center aligned. | ||
| - Allow readonly fields in DataForm when `readOnly` is set to `true`. | ||
| - Adjust the padding when the component is placed inside a `Card`. | ||
| - Introduce `perPageSizes` to control the available sizes of the items per page |
There was a problem hiding this comment.
I'd love if we document this new prop in the README.
|
@oandregal When you get back, I'd love a sanity check here. For me it looks good enough. |
@youknowriad I've prepared #71004 with the things I've noticed. |
What?
Introduce
perPageSizesto control the available sizes of the items per pageWhy?
The consumer would like to customize the number of items per page based on their layout requirements.
How?
Introduce the
perPageSizesoption to the view configTesting Instructions
npm run storybook:devto start the storybookDataViews > Custom Per Page SizesTesting Instructions for Keyboard
Screenshots or screencast