Skip to content

Commit

Permalink
DropdownMenuV2: use the Icon component to render radio checks (#55964)
Browse files Browse the repository at this point in the history
* DropdownMenuV2: use the `Icon` component to render radio checks

* CHANGELOG
  • Loading branch information
ciampo committed Nov 9, 2023
1 parent 369947c commit 1e3dd2a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Expand Up @@ -12,6 +12,7 @@

- `Tabs`: Add `focusable` prop to the `Tabs.TabPanel` sub-component ([#55287](https://github.com/WordPress/gutenberg/pull/55287))
- `Tabs`: Update sub-components to accept relevant HTML element props ([#55860](https://github.com/WordPress/gutenberg/pull/55860))
- `DropdownMenuV2`: Fix radio menu item check icon not rendering correctly in some browsers ([#55964](https://github.com/WordPress/gutenberg/pull/55964))

### Enhancements

Expand Down
15 changes: 7 additions & 8 deletions packages/components/src/dropdown-menu-v2-ariakit/index.tsx
Expand Up @@ -99,6 +99,12 @@ export const DropdownMenuCheckboxItem = forwardRef<
);
} );

const radioCheck = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Circle cx={ 12 } cy={ 12 } r={ 3 }></Circle>
</SVG>
);

export const DropdownMenuRadioItem = forwardRef<
HTMLDivElement,
WordPressComponentProps< DropdownMenuRadioItemProps, 'div', false >
Expand All @@ -119,14 +125,7 @@ export const DropdownMenuRadioItem = forwardRef<
store={ dropdownMenuContext?.store }
render={ <Styled.ItemPrefixWrapper /> }
>
<SVG viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<Circle
cx={ 12 }
cy={ 12 }
r={ 3 }
fill="currentColor"
></Circle>
</SVG>
<Icon icon={ radioCheck } size={ 24 } />
</Ariakit.MenuItemCheck>
{ children }
{ suffix }
Expand Down

0 comments on commit 1e3dd2a

Please sign in to comment.