Skip to content

Commit dcd53a4

Browse files
Make Table multi-selectable again
1 parent f9d6d3b commit dcd53a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

components/table/Table.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ const factory = (TableHead, TableRow) => {
4242

4343
handleRowSelect = (index) => {
4444
if (this.props.onSelect) {
45-
let newSelection = [];
45+
let newSelection = [...this.props.selected];
4646
if (this.props.multiSelectable) {
4747
const position = this.props.selected.indexOf(index);
48-
newSelection = this.props.selected.indexOf(index) !== -1
49-
? this.props.selected.filter((el, idx) => idx !== position)
48+
newSelection = position !== -1
49+
? newSelection.filter((el, idx) => idx !== position)
5050
: newSelection.concat([index]);
5151
} else {
5252
newSelection = [index];

0 commit comments

Comments
 (0)