Skip to content

Commit

Permalink
DropdownMenuV2Ariakit: prevent prefix collapsing if all radios or che…
Browse files Browse the repository at this point in the history
…ckboxes are unselected (#56720)

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

* CHANGELOG

* DRY it up
  • Loading branch information
ciampo authored Dec 8, 2023
1 parent 46ea0ff commit 7872195
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
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

1 comment on commit 7872195

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 7872195.
Some 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.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7143283766
📝 Reported issues:

Please sign in to comment.