Skip to content

Commit

Permalink
Fix ListItem to use icon as element instead of text node
Browse files Browse the repository at this point in the history
  • Loading branch information
JSMike committed Sep 30, 2024
1 parent 2582d44 commit 48868ba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion code/core/src/components/components/tooltip/ListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,17 @@ const ListItem = ({
}: ListItemProps) => {
const commonProps = { active, disabled };
const itemProps = getItemProps(onClick, href, LinkWrapper);
const Icon: React.JSXElementConstructor<any> =
icon as unknown as React.JSXElementConstructor<any>;

return (
<Item {...rest} {...commonProps} {...itemProps}>
<>
{icon && <Left {...commonProps}>{icon}</Left>}
{icon && (
<Left {...commonProps}>
<Icon />
</Left>
)}
{title || center ? (
<Center isIndented={!!(!icon && isIndented)}>
{title && (
Expand Down

0 comments on commit 48868ba

Please sign in to comment.