@@ -10,7 +10,7 @@ import { getTitle } from '../../utils/commonUtil';
1010
1111const SingleContent = React . forwardRef < HTMLInputElement , SharedContentProps > (
1212 ( { inputProps } , ref ) => {
13- const { prefixCls, searchValue, activeValue, displayValues, maxLength, mode } =
13+ const { prefixCls, searchValue, activeValue, displayValues, maxLength, mode, components } =
1414 useSelectInputContext ( ) ;
1515 const { triggerOpen, title : rootTitle , showSearch, classNames, styles } = useBaseProps ( ) ;
1616 const selectContext = React . useContext ( SelectContext ) ;
@@ -70,25 +70,28 @@ const SingleContent = React.forwardRef<HTMLInputElement, SharedContentProps>(
7070 String ( displayValue . label ) . trim ( ) !== '' ;
7171
7272 // Render value
73- const renderValue = displayValue ? (
74- hasOptionStyle ? (
75- < div
76- className = { clsx ( `${ prefixCls } -content-value` , optionClassName ) }
77- style = { {
78- ...( mergedSearchValue ? { visibility : 'hidden' } : { } ) ,
79- ...optionStyle ,
80- } }
81- title = { optionTitle }
82- >
83- { displayValue . label }
84- </ div >
73+ // Only render value when not using custom input in combobox mode
74+ const shouldRenderValue = ! ( combobox && components ?. input ) ;
75+ const renderValue = shouldRenderValue ? (
76+ displayValue ? (
77+ hasOptionStyle ? (
78+ < div
79+ className = { clsx ( `${ prefixCls } -content-value` , optionClassName ) }
80+ style = { {
81+ ...( mergedSearchValue ? { visibility : 'hidden' } : { } ) ,
82+ ...optionStyle ,
83+ } }
84+ title = { optionTitle }
85+ >
86+ { displayValue . label }
87+ </ div >
88+ ) : (
89+ displayValue . label
90+ )
8591 ) : (
86- displayValue . label
92+ < Placeholder show = { ! mergedSearchValue } />
8793 )
88- ) : (
89- < Placeholder show = { ! mergedSearchValue } />
90- ) ;
91-
94+ ) : null ;
9295 // Render
9396 return (
9497 < div
0 commit comments