Skip to content

Commit

Permalink
fix #1182
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Apr 5, 2017
1 parent 00dab2a commit 14fc9b7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/TableHeaderColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,14 @@ class TableHeaderColumn extends Component {
typeof className === 'function' ? className() : className,
!isOnlyHead && dataSort ? 'sort-column' : '');

const title = {
title: ((headerTitle && typeof children === 'string') ? children : headerText)
};
const attr = {};
if (headerTitle) {
if (typeof children === 'string' && !headerText) {
attr.title = children;
} else {
attr.title = headerText;
}
}
return (
<th ref='header-col'
className={ classes }
Expand All @@ -138,7 +143,7 @@ class TableHeaderColumn extends Component {
rowSpan={ this.props.rowSpan }
colSpan={ this.props.colSpan }
data-is-only-head={ this.props.isOnlyHead }
{ ...title }>
{ ...attr }>
{ children }{ sortCaret }
<div onClick={ e => e.stopPropagation() }>
{ this.props.filter && !isOnlyHead ? this.getFilters() : null }
Expand Down

0 comments on commit 14fc9b7

Please sign in to comment.