We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f9d6d3b commit dcd53a4Copy full SHA for dcd53a4
components/table/Table.js
@@ -42,11 +42,11 @@ const factory = (TableHead, TableRow) => {
42
43
handleRowSelect = (index) => {
44
if (this.props.onSelect) {
45
- let newSelection = [];
+ let newSelection = [...this.props.selected];
46
if (this.props.multiSelectable) {
47
const position = this.props.selected.indexOf(index);
48
- newSelection = this.props.selected.indexOf(index) !== -1
49
- ? this.props.selected.filter((el, idx) => idx !== position)
+ newSelection = position !== -1
+ ? newSelection.filter((el, idx) => idx !== position)
50
: newSelection.concat([index]);
51
} else {
52
newSelection = [index];
0 commit comments