Skip to content

Commit 0b57d95

Browse files
committed
[Table] Added key to selectall column in TableHeader. Addresses mui#2028
1 parent c66ff3d commit 0b57d95

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/table/table-header.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ const TableHeader = React.createClass({
120120
children.push(child);
121121
});
122122

123+
console.log('key is ', props.key)
123124
return React.cloneElement(child, props, children);
124125
},
125126

@@ -152,8 +153,8 @@ const TableHeader = React.createClass({
152153
},
153154

154155
_getSelectAllCheckboxColumn(props) {
155-
if (!this.props.displaySelectAll) return this._getCheckboxPlaceholder(props);
156-
156+
if (!this.props.displaySelectAll) return this._getCheckboxPlaceholder(props);
157+
157158
const checkbox =
158159
<Checkbox
159160
key="selectallcb"
@@ -163,8 +164,9 @@ const TableHeader = React.createClass({
163164
checked={this.props.selectAllSelected}
164165
onCheck={this._onSelectAll} />;
165166

167+
const key = 'hpcb' + props.rowNumber;
166168
return (
167-
<TableHeaderColumn style={{width: 24}}>
169+
<TableHeaderColumn key={key} style={{width: 24}}>
168170
{checkbox}
169171
</TableHeaderColumn>
170172
);

0 commit comments

Comments
 (0)