fix invalid title in div

This commit is contained in:
afc163 2018-12-13 22:51:53 +08:00
parent 9c777231e3
commit 860809f173
No known key found for this signature in database
GPG Key ID: 5F00908D72002306

View File

@ -840,6 +840,7 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
</div>
);
}
const sortTitleString = (sortButton && typeof sortTitle === 'string') ? sortTitle : undefined;
return {
...column,
className: classNames(column.className, {
@ -851,7 +852,7 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
title: [
<div
key="title"
title={sortButton ? sortTitle : undefined}
title={sortTitleString}
className={sortButton ? `${prefixCls}-column-sorters` : undefined}
onClick={() => this.toggleSortOrder(column)}
>