Skip to content

Commit 3d1e26c

Browse files
(Picklist): restore the icon prop
1 parent 9a84e05 commit 3d1e26c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/scripts/Picklist.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ export type PicklistItemProps = {
627627
value?: string | number;
628628
selected?: boolean;
629629
disabled?: boolean;
630+
icon?: string;
630631
children?: React.ReactNode;
631632
};
632633

@@ -638,6 +639,7 @@ export const PicklistItem: FC<PicklistItemProps> = ({
638639
selected: selected_,
639640
value,
640641
disabled,
642+
icon,
641643
children,
642644
}) => {
643645
const { values, multiSelect, onSelect, focusedValue, optionIdPrefix } =
@@ -676,14 +678,21 @@ export const PicklistItem: FC<PicklistItemProps> = ({
676678
onClick={onClick}
677679
>
678680
<span className='slds-media__figure slds-listbox__option-icon'>
679-
{selected && (
681+
{icon ? (
682+
<Icon
683+
category='utility'
684+
icon={icon}
685+
size='x-small'
686+
textColor='currentColor'
687+
/>
688+
) : selected ? (
680689
<Icon
681690
category='utility'
682691
icon='check'
683692
size='x-small'
684693
textColor='currentColor'
685694
/>
686-
)}
695+
) : null}
687696
</span>
688697
<span className='slds-media__body'>
689698
<span className='slds-truncate' title={String(label || children)}>

0 commit comments

Comments
 (0)