File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export interface TableCellProps<ValueType> {
1818 indent ?: number ;
1919 indentSize ?: number ;
2020 column ?: ColumnType ;
21+ title ?: string ;
2122 expandIcon ?: React . ReactNode ;
2223 component ?: CustomizeComponent ;
2324}
@@ -56,7 +57,7 @@ export default class TableCell<ValueType> extends React.Component<TableCellProps
5657 } else {
5758 text = get ( record , dataIndex ) ;
5859 }
59- let tdProps : Cell = { } ;
60+ let tdProps : Cell & { title ?: string } = { } ;
6061 let colSpan : number ;
6162 let rowSpan : number ;
6263
@@ -108,13 +109,11 @@ export default class TableCell<ValueType> extends React.Component<TableCellProps
108109 if ( column . ellipsis ) {
109110 if ( typeof text === 'string' ) {
110111 tdProps . title = text ;
111- } else if (
112- text &&
113- text . props &&
114- text . props . children &&
115- typeof text . props . children === 'string'
116- ) {
117- tdProps . title = text . children ;
112+ } else if ( text ) {
113+ const { props : textProps } = text as React . ReactElement < any > ;
114+ if ( textProps && textProps . children && typeof textProps . children === 'string' ) {
115+ tdProps . title = textProps . children ;
116+ }
118117 }
119118 }
120119
You can’t perform that action at this time.
0 commit comments