This commit is contained in:
Tomas Bures 2019-08-21 13:18:03 +02:00
parent ebb6c2ff74
commit a17ee3d9bf
3 changed files with 46 additions and 16 deletions

View file

@ -150,12 +150,18 @@ class Table extends Component {
values: keysToFetch
});
const oldSelectionMap = this.selectionMap;
this.selectionMap = new Map();
for (const row of response.data) {
const key = row[this.props.selectionKeyIndex];
if (this.selectionMap.has(key)) {
this.selectionMap.set(key, row);
if (oldSelectionMap.has(key)) {
this.selectionMap.set(key, row)
}
}
if (this.selectionMap.size !== oldSelectionMap.size) {
this.notifySelection(this.props.onSelectionChangedAsync, this.selectionMap);
}
}
}