Skip to content

Commit

Permalink
Make Table multi-selectable again
Browse files Browse the repository at this point in the history
  • Loading branch information
tuckerconnelly committed Sep 2, 2016
1 parent f9d6d3b commit dcd53a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/table/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ const factory = (TableHead, TableRow) => {

handleRowSelect = (index) => {
if (this.props.onSelect) {
let newSelection = [];
let newSelection = [...this.props.selected];
if (this.props.multiSelectable) {
const position = this.props.selected.indexOf(index);
newSelection = this.props.selected.indexOf(index) !== -1
? this.props.selected.filter((el, idx) => idx !== position)
newSelection = position !== -1
? newSelection.filter((el, idx) => idx !== position)
: newSelection.concat([index]);
} else {
newSelection = [index];
Expand Down

0 comments on commit dcd53a4

Please sign in to comment.