Skip to content
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

DropdownMenuV2Ariakit: prevent prefix collapsing if all radios or checkboxes are unselected #56720

Merged
merged 3 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
- `ToolsPanel`: fix a performance issue ([#56770](https://github.com/WordPress/gutenberg/pull/56770)).
- `BorderControl`: adjust `BorderControlDropdown` Button size to fix misaligned border ([#56730](https://github.com/WordPress/gutenberg/pull/56730)).

### Internal

- `DropdownMenuV2Ariakit`: prevent prefix collapsing if all radios or checkboxes are unselected ([#56720](https://github.com/WordPress/gutenberg/pull/56720)).

## 25.13.0 (2023-11-29)

### Enhancements
Expand Down
12 changes: 12 additions & 0 deletions packages/components/src/dropdown-menu-v2-ariakit/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,18 @@ export const ItemPrefixWrapper = styled.span`
/* Always occupy the first column, even when auto-collapsing */
grid-column: 1;

/*
* Even when the item is not checked, occupy the same screen space to avoid
* the space collapside when no items are checked.
*/
${ DropdownMenuCheckboxItem } > &,
${ DropdownMenuRadioItem } > & {
/* Same width as the check icons */
min-width: ${ space( 6 ) };
}

${ DropdownMenuCheckboxItem } > &,
${ DropdownMenuRadioItem } > &,
&:not( :empty ) {
margin-inline-end: ${ space( 2 ) };
}
Expand Down
Loading