Skip to content

Commit

Permalink
Merge pull request #15926 from primefaces/issue-15903
Browse files Browse the repository at this point in the history
Fixed #15903 - Table | Multiple Selection with dataKey shows wrong se…
  • Loading branch information
cetincakiroglu authored Jul 4, 2024
2 parents c265d84 + 10281dc commit 2140f19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1849,7 +1849,7 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable
}
}

selectRange(event: MouseEvent | KeyboardEvent, rowIndex: number) {
selectRange(event: MouseEvent | KeyboardEvent, rowIndex: number, isMetaKeySelection? : boolean | undefined) {
let rangeStart, rangeEnd;

if (<number>this.anchorRowIndex > rowIndex) {
Expand All @@ -1871,7 +1871,7 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable
let rangeRowsData = [];
for (let i = <number>rangeStart; i <= <number>rangeEnd; i++) {
let rangeRowData = this.filteredValue ? this.filteredValue[i] : this.value[i];
if (!this.isSelected(rangeRowData)) {
if (!this.isSelected(rangeRowData) && !isMetaKeySelection) {
if (!this.isRowSelectable(rangeRowData, rowIndex)) {
continue;
}
Expand Down Expand Up @@ -3633,7 +3633,7 @@ export class SelectableRow implements OnInit, OnDestroy {
if (event.code === 'KeyA' && (event.metaKey || event.ctrlKey) && this.dt.selectionMode === 'multiple') {
const data = this.dt.dataToRender(this.dt.processedData);
this.dt.selection = [...data];
this.dt.selectRange(event, data.length - 1);
this.dt.selectRange(event, data.length - 1, true);

event.preventDefault();
}
Expand Down

0 comments on commit 2140f19

Please sign in to comment.