Skip to content

Commit

Permalink
chore(*): refactor selection service
Browse files Browse the repository at this point in the history
  • Loading branch information
ddincheva committed Aug 21, 2019
1 parent c415882 commit f9cc690
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion projects/igniteui-angular/src/lib/core/grid-selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,8 @@ export class IgxGridSelectionService {
if (this.grid.rowSelection === 'none' || this.isRowDeleted(rowID)) { return; }
clearPrevSelection = this.grid.rowSelection === 'single' || clearPrevSelection;

const newSelection = clearPrevSelection ? [rowID] : [...this.getSelectedRows(), rowID];
const newSelection = clearPrevSelection ? [rowID] : this.getSelectedRows().indexOf(rowID) !== -1 ?
this.getSelectedRows() : [...this.getSelectedRows(), rowID];
const removed = clearPrevSelection ? this.getSelectedRows() : [];
this.emitRowSelectionEvent(newSelection, [rowID], removed, event);
}
Expand Down

0 comments on commit f9cc690

Please sign in to comment.