Make Table multi-selectable again

old
Tucker Connelly 2016-09-02 11:32:55 -04:00
parent f9d6d3b1c6
commit dcd53a4e75
1 changed files with 3 additions and 3 deletions

View File

@ -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];