-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Try adding optional infinite scroll to dataviews #70955
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
base: trunk
Are you sure you want to change the base?
Conversation
Size Change: +421 B (+0.02%) Total Size: 1.91 MB
ℹ️ View Unchanged
|
|
No particular reason apart from it being a more common UI pattern in that type of view, but given it's an opt-in it should be fine to add it for all views. |
Thanks for the feedback Riad! I've updated to add infiniteScrollHandler inside paginationInfo and allow infinite scroll on all view types. There's still a few things that need to be added before the PR is ready; I'll continue working on it in the next few days. |
It'd be great to update the stories in the storybook so that it's testable there as well. It should hopefully be pretty easy to update the views:
Possibly we might need a bigger data set in the stories. I thnk Jupiter and Saturn have some more moons that could be added 😄 |
50af36d
to
6e25cd6
Compare
How do I get those image URLs from |
Good question. I found this gallery which is creative commons - https://www.flickr.com/photos/lightsinthedark/albums/72157694956141104/ But I'm not sure how you get the links. edit: Actually, maybe not every image is creative commons, it seems only some, might be ok for our usage. |
What?
It's likely this will be needed as DataViews is adopted in more wp-admin screens.
This PR proposes adding an optional
infiniteScrollHandler
prop to the DataViews component. If this prop exists and is a function, an infinite scroll toggle is enabled in the view config for the grid layout type only (it could be expanded to other layout types if it makes sense to do so).To try this out, this PR also changes the PostList to pass an
infiniteScrollHandler
into DataViews, so its functionality can be tested on the Pages screen (provided there are enough pages to trigger pagination).The PostList change doesn't need to be done in this PR, I just added it so it's easier to test. But the main question for now is whether this API is good.
Testing Instructions