@@ -114,6 +114,8 @@ export const SelectPickerOption = ({
114
114
} = props
115
115
const { description, startIcon, endIcon } = data ?? { }
116
116
const showDescription = ! ! description
117
+ // __isNew__ denotes the new option to be created
118
+ const isCreatableOption = '__isNew__' in data && data . __isNew__
117
119
118
120
const handleChange = ( e : ChangeEvent < HTMLInputElement > ) => {
119
121
e . preventDefault ( )
@@ -124,8 +126,7 @@ export const SelectPickerOption = ({
124
126
return (
125
127
< components . Option { ...props } >
126
128
< div className = "flexbox dc__align-items-center dc__gap-8" >
127
- { /* __isNew__ denotes the new option to be created */ }
128
- { isMulti && ! ( '__isNew__' in data && data . __isNew__ ) && (
129
+ { isMulti && ! isCreatableOption && (
129
130
< Checkbox
130
131
onChange = { noop }
131
132
onClick = { handleChange }
@@ -139,7 +140,9 @@ export const SelectPickerOption = ({
139
140
< div className = "dc__no-shrink icon-dim-20 flex dc__fill-available-space" > { startIcon } </ div >
140
141
) }
141
142
< div className = "flex-grow-1" >
142
- < h4 className = "m-0 cn-9 fs-13 fw-4 lh-20 dc__truncate" > { label } </ h4 >
143
+ < h4 className = { `m-0 fs-13 ${ isCreatableOption ? 'cb-5' : 'cn-9' } fw-4 lh-20 dc__truncate` } >
144
+ { label }
145
+ </ h4 >
143
146
{ /* Add support for custom ellipsis if required */ }
144
147
{ showDescription && (
145
148
< p
@@ -276,7 +279,6 @@ export const SelectPickerGroupHeading = ({
276
279
return (
277
280
< components . GroupHeading { ...props } onClick = { toggleGroupHeadingSelection } >
278
281
< div className = "flexbox dc__align-items-center dc__gap-8" >
279
- { /* __isNew__ denotes the new option to be created */ }
280
282
{ isGroupHeadingSelectable && (
281
283
< Checkbox
282
284
onChange = { noop }
0 commit comments