-
Notifications
You must be signed in to change notification settings - Fork 4.6k
DataViews: Try zero intrinsic padding #73855
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
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
Size Change: -821 B (-0.03%) Total Size: 2.57 MB
ℹ️ View Unchanged
|
|
Thanks for scratching the itch @jameskoster, I always think it's good to try out these ideas in code and see how it feels. It's compelling! Conceptually I also like the idea of the container handling the scrolling. In practice, though, I believe it introduces another issues which is that the footers don't stick to the bottom of the container when there isn't enough content to push it out to the bottom. Here's some screenshots from the Pages view and of the Media modal:
While these issues are blockers, I wouldn't say it necessarily rules out your idea here. And now that we've standardised on What do you think about these "sticky" issues... worth pursuing further or does it feel like a deal breaker? The one other tiny issue I ran into is that while focus styles on buttons are working pretty well, the badge on an active filter gets cut off:
|
|
Oh shoot, I didn't test a list that doesn't fill the container so didn't spot the footer problem, thanks for pointing that out. Maybe a simple Padding aside, the more I wrestled with the This 'make DataViews less opinionated about layout and style' topic is a huge rabbit hole 😅 |
|
Indeed, I think we'll encounter lots more cases where free composition feels like the right approach given how many different things using DataViews will want to inject buttons or little bits of UI in various places. That said, it's also good for there to be a version of things (e.g. DataViewsPicker) that kind of "just works" without the consumer needing to know about where to put things 🤔
Yeah, I was just thinking that about
But yes, it's a big topic indeed! Thanks for continuing the discussion / ideation. Hopefully we can get there in little steps 👍 |





Follow-up to #73334.
I had to scratch this itch. The code is very messy, but can be tidied if we think this is worth pursuing at all. DataViews now has zero intrinsic padding meaning it can be placed in any container and work as expected without additional code.
The only piece I couldn't get working is making
.dataviews__view-actionsand.dataviews-footerstick to the left of the container when table layout is wide enough to cause horizontal scrolling. This is due to the parent container handling scrolling rather than.dataviews-wrapper. Maybe there's a js solution to this, or maybe it's the limiting factor that curtails this approach altogether?I'm drafting this PR mostly in case it inspires any further ideas. If not that's fine. Like I said, I had to scratch the itch :)
cc @andrewserong @youknowriad.