Skip to content

Commit

Permalink
fix: previous filters deselection upon each 'Select All' click (#4854)
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledfahmy123 authored Feb 26, 2024
1 parent 6cc6ec1 commit 7e6cef3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/pages/studyView/table/ClinicalTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,16 @@ export default class ClinicalTable extends React.Component<

@autobind
addAll(selectedRows: ClinicalDataCountSummary[]) {
this.props.onUserSelection(selectedRows.map(row => row.value));
// To prevent the deselection of previously applied filters upon each "Select All" click,
// we retrieve the existing filters and concatenate them with the new ones.
let filters = toJS(this.props.filters);

let uniqueSelectedRows = selectedRows
.map(row => row.value)
.filter(item => !filters.includes(item));

filters = filters.concat(uniqueSelectedRows);
this.props.onUserSelection(filters);
}

@autobind
Expand Down

0 comments on commit 7e6cef3

Please sign in to comment.