@@ -19,7 +19,6 @@ const SingleContent = React.forwardRef<HTMLInputElement, SharedContentProps>(
1919
2020 const combobox = mode === 'combobox' ;
2121 const displayValue = displayValues [ 0 ] ;
22- const hasDisplayValue = displayValue !== null && displayValue !== undefined ;
2322
2423 // Implement the same logic as the old SingleSelector
2524 const mergedSearchValue = React . useMemo ( ( ) => {
@@ -35,7 +34,7 @@ const SingleContent = React.forwardRef<HTMLInputElement, SharedContentProps>(
3534 let style : React . CSSProperties | undefined ;
3635 let titleValue : string | undefined ;
3736
38- if ( hasDisplayValue && selectContext ?. flattenOptions ) {
37+ if ( displayValue && selectContext ?. flattenOptions ) {
3938 const option = selectContext . flattenOptions . find ( ( opt ) => opt . value === displayValue . value ) ;
4039 if ( option ?. data ) {
4140 className = option . data . className ;
@@ -44,7 +43,7 @@ const SingleContent = React.forwardRef<HTMLInputElement, SharedContentProps>(
4443 }
4544 }
4645
47- if ( hasDisplayValue && ! titleValue ) {
46+ if ( displayValue && ! titleValue ) {
4847 titleValue = getTitle ( displayValue ) ;
4948 }
5049
@@ -65,7 +64,7 @@ const SingleContent = React.forwardRef<HTMLInputElement, SharedContentProps>(
6564
6665 // ========================== Render ==========================
6766 // Render value
68- const renderValue = hasDisplayValue ? (
67+ const renderValue = displayValue ? (
6968 hasOptionStyle ? (
7069 < div
7170 className = { clsx ( `${ prefixCls } -content-value` , optionClassName ) }
@@ -89,7 +88,7 @@ const SingleContent = React.forwardRef<HTMLInputElement, SharedContentProps>(
8988 < div
9089 className = { clsx (
9190 `${ prefixCls } -content` ,
92- hasDisplayValue && `${ prefixCls } -content-has-value` ,
91+ displayValue && `${ prefixCls } -content-has-value` ,
9392 mergedSearchValue && `${ prefixCls } -content-has-search-value` ,
9493 hasOptionStyle && `${ prefixCls } -content-has-option-style` ,
9594 classNames ?. content ,
0 commit comments