Skip to content

Commit

Permalink
Fixed #1305 - DataTable multi selection with meta key
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed May 31, 2021
1 parent 17e2f1b commit 3b15695
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/datatable/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ export default {
if (this.selectionMode) {
const rowData = e.data;
const rowIndex = e.index;
const rowIndex = e.index + this.d_first;
if (this.isMultipleSelectionMode() && event.shiftKey && this.anchorRowIndex != null) {
DomHandler.clearSelection();
Expand Down Expand Up @@ -930,11 +930,13 @@ export default {
}
const value = this.processedData;
let _selection = [];
let _selection = [...this.selection];
for(let i = rangeStart; i <= rangeEnd; i++) {
let rangeRowData = value[i];
_selection.push(rangeRowData);
this.$emit('row-select', {originalEvent: event, data: rangeRowData, type: 'row'});
if (!_selection.includes(rangeRowData)) {
_selection.push(rangeRowData);
this.$emit('row-select', {originalEvent: event, data: rangeRowData, type: 'row'});
}
}
this.$emit('update:selection', _selection);
Expand Down

0 comments on commit 3b15695

Please sign in to comment.