Repository navigation
UI: Keep popup grid areas out of inline list parts - #86652
Conversation
The item popup placed List, Empty and Status in its named grid areas regardless of where they rendered. An inline Autocomplete or Combobox placed in a consumer's CSS grid then landed in an extra implicit row and column. Scope the placements to the popup so inline parts follow the surrounding layout. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
🤖 PR meta 🤖🎉 PropsIf 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +816 B (+0.01%) Total Size: 8.64 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Undo restores the post selection when another synced entity is loaded (RTC WebSocket) in
|
Co-Authored-By: Claude <noreply@anthropic.com>
Any break in the popup placement shows in every Select, Combobox and Autocomplete popup story. Keep the inline layout test, since no story renders inline parts in a consumer grid. Co-Authored-By: Claude <noreply@anthropic.com>
| } ); | ||
| } ); | ||
|
|
||
| it( 'places inline list parts in the grid of the consumer', async () => { |
There was a problem hiding this comment.
I think this is worth testing because it has the potential to regress in future iterations, and partial regressions (like with Empty) may not be immediately obvious in Storybook.
What?
See #86338.
Keeps an inline
AutocompleteorComboboxlist, empty state, and status from being placed in grid areas that only exist inside the item popup. When these parts render inline in a consumer's CSS grid, they now follow that grid like any other child.Why?
The item popup is a grid with the named areas
header,status, andmain, andList,Empty, andStatuswere placed in those areas wherever they rendered. Inline, the parts render in the consumer's layout instead, where those names do not exist. In a grid, each unknown area name creates implicit lines, so the part lands in an extra implicit row and column, outside the tracks the consumer defined. The special characters picker in #86338 hit this with a fixed-height grid aroundAutocomplete.EmptyandAutocomplete.List, and had to switch the wrapper to a flex column. Point 5 of #83538 (comment) describes the same mismatch.The blast radius is narrow. Nothing changes for the higher-level components (
Select,SearchableSelect,SearchableChipSelect, and their controls) or forComboboxandAutocompleteused with a popup, whose popups render the same as before. The change is only observable whenComboboxorAutocompleteis usedinlineandList,Empty, orStatusis a direct child of the consumer's own CSS grid. In that setup the parts were already misplaced. The only consumer that could break is one whose grid defines its ownmainorstatusareas and relies on these parts landing in them, which would now need to place them with aclassName. A quick audit of public third-party code that uses these primitives found no inline usage in a grid. The projects found all render the parts inside a popup, and the one inline consumer in this repository does not use a grid.How?
The placements are scoped to descendants of the popup rather than direct children, so a consumer who wraps parts in a
display: contentselement inside the popup keeps the current layout.:where()keeps the specificity of each rule as it was, so existing consumer overrides still win as before.Testing Instructions
display: grid; grid-template-rows: auto minmax(0, 1fr).zzzin the input. "No commands found." should appear at the top of that element. On trunk, it appears at its bottom, offset to the right.Screenshots or screencast
An inline
Autocompletein a fixed-height grid with rowsauto minmax(0, 1fr)(dashed outline), holdingAutocomplete.EmptyandAutocomplete.List.The
Comboboxpopup is identical before and after: