File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export interface TableCellProps<ValueType> {
18
18
indent ?: number ;
19
19
indentSize ?: number ;
20
20
column ?: ColumnType ;
21
+ title ?: string ;
21
22
expandIcon ?: React . ReactNode ;
22
23
component ?: CustomizeComponent ;
23
24
}
@@ -56,7 +57,7 @@ export default class TableCell<ValueType> extends React.Component<TableCellProps
56
57
} else {
57
58
text = get ( record , dataIndex ) ;
58
59
}
59
- let tdProps : Cell = { } ;
60
+ let tdProps : Cell & { title ?: string } = { } ;
60
61
let colSpan : number ;
61
62
let rowSpan : number ;
62
63
@@ -108,13 +109,11 @@ export default class TableCell<ValueType> extends React.Component<TableCellProps
108
109
if ( column . ellipsis ) {
109
110
if ( typeof text === 'string' ) {
110
111
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
+ }
118
117
}
119
118
}
120
119
You can’t perform that action at this time.
0 commit comments