Skip to content

Commit

Permalink
fix(AnalyticalTable): add info in onRowSelected event whether row is …
Browse files Browse the repository at this point in the history
…selected or not (#176)

[ci skip]
  • Loading branch information
vbersch authored Oct 8, 2019
1 parent 94c439b commit 4d6eaa4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ export const useRowSelection = (onRowSelected) => {
(row) => (e) => {
if (row.isAggregated) return;
const newKey = row.index;
setSelectedRow(selectedRow === newKey ? null : newKey);
const newSelectedRow = selectedRow === newKey ? null : newKey;
setSelectedRow(newSelectedRow);
if (typeof onRowSelected === 'function') {
onRowSelected(Event.of(null, e, { row }));
onRowSelected(Event.of(null, e, { row, isSelected: !!newSelectedRow || newSelectedRow === 0 }));
}
},
[selectedRow, setSelectedRow]
Expand Down

0 comments on commit 4d6eaa4

Please sign in to comment.