Skip to content

Commit acb396f

Browse files
committed
feat: hide start icon in option in case of multi select
1 parent c0dcb90 commit acb396f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Shared/Components/SelectPicker/common.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ export const SelectPickerOption = <OptionValue, IsMulti extends boolean>({
148148
/>
149149
)}
150150
<div className={`flex left ${showDescription ? 'top' : ''} dc__gap-8`}>
151-
{startIcon && (
151+
{/* startIcon is not to be shown in option in case of multi select */}
152+
{!isMulti && startIcon && (
152153
<div className="dc__no-shrink icon-dim-20 flex dc__fill-available-space">{startIcon}</div>
153154
)}
154155
<div className="flex-grow-1">
@@ -200,7 +201,7 @@ export const SelectPickerMultiValueLabel = <OptionValue, IsMulti extends boolean
200201
Pick<SelectPickerProps<OptionValue, IsMulti>['multiSelectProps'], 'getIsOptionValid'>) => {
201202
const { data, selectProps } = props
202203
const isOptionValid = getIsOptionValid(data)
203-
const iconToDisplay = isOptionValid ? data.startIcon || data.endIcon : <ICErrorExclamation />
204+
const iconToDisplay = isOptionValid ? (data.startIcon || data.endIcon) ?? null : <ICErrorExclamation />
204205

205206
return (
206207
<div className="flex dc__gap-4 mw-0 dc__truncate">

0 commit comments

Comments
 (0)