@@ -454,24 +454,33 @@ export default function generateSelector<
454
454
} , [ mergedSearchValue ] ) ;
455
455
456
456
// ============================ Selector ============================
457
- let displayValues = React . useMemo < DisplayLabelValueType [ ] > (
458
- ( ) =>
459
- mergedRawValue . map ( ( val : RawValueType ) => {
460
- const valueOptions = getValueOption ( [ val ] ) ;
461
- const displayValue = getLabeledValue ( val , {
462
- options : valueOptions ,
463
- prevValue : baseValue ,
464
- labelInValue : mergedLabelInValue ,
465
- optionLabelProp : mergedOptionLabelProp ,
466
- } ) ;
467
-
468
- return {
469
- ...displayValue ,
470
- disabled : isValueDisabled ( val , valueOptions ) ,
471
- } ;
472
- } ) ,
473
- [ baseValue , mergedOptions ] ,
474
- ) ;
457
+ let displayValues = React . useMemo < DisplayLabelValueType [ ] > ( ( ) => {
458
+ const tmpValues = mergedRawValue . map ( ( val : RawValueType ) => {
459
+ const valueOptions = getValueOption ( [ val ] ) ;
460
+ const displayValue = getLabeledValue ( val , {
461
+ options : valueOptions ,
462
+ prevValue : baseValue ,
463
+ labelInValue : mergedLabelInValue ,
464
+ optionLabelProp : mergedOptionLabelProp ,
465
+ } ) ;
466
+
467
+ return {
468
+ ...displayValue ,
469
+ disabled : isValueDisabled ( val , valueOptions ) ,
470
+ } ;
471
+ } ) ;
472
+
473
+ if (
474
+ ! mode &&
475
+ tmpValues . length === 1 &&
476
+ tmpValues [ 0 ] . value === null &&
477
+ tmpValues [ 0 ] . label === null
478
+ ) {
479
+ return [ ] ;
480
+ }
481
+
482
+ return tmpValues ;
483
+ } , [ baseValue , mergedOptions , mode ] ) ;
475
484
476
485
// Polyfill with cache label
477
486
displayValues = useCacheDisplayValue ( displayValues ) ;
0 commit comments