DataViews: Add scrollY layout option for table views#76091
DataViews: Add scrollY layout option for table views#76091dilirity wants to merge 4 commits intoWordPress:trunkfrom
Conversation
Introduce a `scrollY` layout property for table and pickerTable views that controls where vertical scrolling occurs. When set to `'table'`, the table body scrolls independently while filters and actions remain fixed at the top. Horizontal scroll detection is also delegated to the inner scroll container so the sticky actions column border appears correctly.
|
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. |
|
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. |
|
Closing as not needed. |
What?
Adds a new
scrollYlayout option to the DataViews table and pickerTable view types.CleanShot.2026-03-04.at.11.12.16.mp4
Why?
Currently, the entire DataViews wrapper scrolls as one unit. In some use cases (e.g. dense admin tables), it's desirable to keep the view actions and filters pinned at the top while only the table body scrolls vertically. Additionally, the horizontal scroll needs to be handled by the correct container so the sticky actions column shows its border only when overlapping content.
How?
scrollY?: 'wrapper' | 'table'to theViewTableandViewPickerTablelayout types. Defaults to'wrapper'(current behavior).scrollYis'table', the wrapper disables vertical overflow (overflow-y: hidden) and the table is wrapped in an inner scroll container that handles both vertical and horizontal scrolling.scrollContainerRefis threaded throughDataViewsContextso the table component can expose the inner scroll element to the parent for infinite scroll support and horizontal scroll-end detection.DataViewsandDataViewsPickerattaches to the correct scroll container based on the mode.useIsHorizontalScrollEndreceives the appropriate ref so the actions column border logic works with either scroll mode.Testing Instructions
view.layout.scrollYset to'table'.scrollYunset or set to'wrapper'to confirm default behavior is unchanged.Testing Instructions for Keyboard
scrollY. Switch towrapperto see the original scroll behavior, ortableto see the new scroll behavior: