Skip to content

Commit

Permalink
Do not use asChild for indicator wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed May 9, 2023
1 parent f488f8a commit ccb6839
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions packages/components/src/ui/radix-dropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,7 @@ export const DropdownMenuCheckboxItem = ( {
return (
<DropdownMenuStyled.CheckboxItem { ...props } checked={ checked }>
<DropdownMenuStyled.ItemPrefixWrapper>
{ /*
TODO: adding `asChild` seems to trigger an error due to the fact
that `Icon` doesn't forward refs to the underlying dom elements.
*/ }
<DropdownMenuPrimitive.ItemIndicator asChild>
<DropdownMenuPrimitive.ItemIndicator>
{ ( checked === 'indeterminate' || checked === true ) && (
<Icon
icon={
Expand Down Expand Up @@ -232,11 +228,7 @@ export const DropdownMenuRadioItem = ( {
return (
<DropdownMenuStyled.RadioItem { ...props }>
<DropdownMenuStyled.ItemPrefixWrapper>
{ /*
TODO: adding `asChild` seems to trigger an error due to the fact
that `Icon` doesn't forward refs to the underlying dom elements.
*/ }
<DropdownMenuPrimitive.ItemIndicator asChild>
<DropdownMenuPrimitive.ItemIndicator>
<Icon icon={ radioDot } size={ 20 } />
</DropdownMenuPrimitive.ItemIndicator>
</DropdownMenuStyled.ItemPrefixWrapper>
Expand Down

0 comments on commit ccb6839

Please sign in to comment.