@@ -6,12 +6,13 @@ import useBaseProps from '../../hooks/useBaseProps';
66import Placeholder from './Placeholder' ;
77import type { SharedContentProps } from '.' ;
88import SelectContext from '../../SelectContext' ;
9+ import { getTitle } from '../../utils/commonUtil' ;
910
1011const SingleContent = React . forwardRef < HTMLInputElement , SharedContentProps > (
1112 ( { inputProps } , ref ) => {
1213 const { prefixCls, searchValue, activeValue, displayValues, maxLength, mode } =
1314 useSelectInputContext ( ) ;
14- const { triggerOpen } = useBaseProps ( ) ;
15+ const { triggerOpen, title : rootTitle } = useBaseProps ( ) ;
1516 const selectContext = React . useContext ( SelectContext ) ;
1617
1718 const [ inputChanged , setInputChanged ] = React . useState ( false ) ;
@@ -45,14 +46,23 @@ const SingleContent = React.forwardRef<HTMLInputElement, SharedContentProps>(
4546 restProps = {
4647 ...restProps ,
4748 ...rest ,
49+ title : getTitle ( option . data ) ,
4850 className : clsx ( restProps . className , className ) ,
4951 style : { ...restProps . style , ...style } ,
5052 } ;
5153 }
5254 }
5355
56+ if ( displayValue && ! restProps . title ) {
57+ restProps . title = getTitle ( displayValue ) ;
58+ }
59+
60+ if ( rootTitle !== undefined ) {
61+ restProps . title = rootTitle ;
62+ }
63+
5464 return restProps ;
55- } , [ displayValue , selectContext ?. flattenOptions , prefixCls , mergedSearchValue ] ) ;
65+ } , [ displayValue , selectContext ?. flattenOptions , prefixCls , mergedSearchValue , rootTitle ] ) ;
5666
5767 React . useEffect ( ( ) => {
5868 if ( combobox ) {
0 commit comments