Dashboard: contain widget body within its tile to prevent page overflow#78627
Merged
Conversation
add layout containment so tall content scrolls within the cell
|
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. |
|
Size Change: 0 B Total Size: 8.04 MB ℹ️ View Unchanged
|
simison
approved these changes
May 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Adds layout containment to the dashboard widget chrome so a widget whose body is taller than its tile scrolls internally instead of overflowing the grid cell and adding empty scroll space below the dashboard.
Single-line change in
routes/dashboard/widget-dashboard/components/widget-chrome/widget-chrome.module.css.Why?
In the fixed-row grid surface, each tile's height comes from its row span (
grid-auto-rows). The grid item carriesmin-height: auto, which let a tall widget's intrinsic content height propagate up theheight: 100%chain, past the chrome'soverflow: clip, and push the body beyond its allotted cell.When the widget sat at the bottom of the grid, that overflow extended the scroll area of the page and produced unwanted empty space at the end of it, even though the widget body already had its own internal scrollbar.
Measured on the Activity widget (cell
424px, content~617px): the tile leaked193pxpast its cell; with the widget last in the grid the page scrolled433pxbeyond the grid's own height. After the fix the leak is0and the page no longer extends.How?
contain: layouton.widgetChromesevers the size propagation from the widget body into the grid item's automatic minimum size.It was chosen deliberately over the alternatives:
overflow: hidden/overflow: clipon the chrome root does not stop the leak (the intrinsic size still feedsmin-height: auto).min-height: 0along the chain only reduces it partially.contain: sizewould stop it but breaks the masonry surface, which measures the tile from its content.Layout containment contains layout only, not
sizeorpaint, so:Testing Instructions
Before
After