Skip to content

Commit a387ef4

Browse files
committed
⚡ add title to ellipsis cell
close ant-design/ant-design#19293
1 parent 0c31155 commit a387ef4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/TableCell.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,19 @@ export default class TableCell<ValueType> extends React.Component<TableCellProps
105105
[`${prefixCls}-cell-break-word`]: !!column.width,
106106
});
107107

108+
if (column.ellipsis) {
109+
if (typeof text === 'string') {
110+
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;
118+
}
119+
}
120+
108121
return (
109122
<BodyCell className={cellClassName} onClick={this.handleClick} {...tdProps}>
110123
{indentText}

0 commit comments

Comments
 (0)