Skip to content

Commit

Permalink
fix(useRowSelect): change to toggleRowSelected reducer to use the pre…
Browse files Browse the repository at this point in the history
…vious state (#2651)

Chane to toggleRowSelected reducer action to use the previous state. The reasoning for this change is that due to when row.isSelected was being updated when you would select another row it would deselect the previous row.

(#2171)

Co-authored-by: Chase Caynoski <[email protected]>
Co-authored-by: Tanner Linsley <[email protected]>
  • Loading branch information
3 people authored Oct 5, 2020
1 parent cdd1213 commit 1d92c6d
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/plugin-hooks/useRowSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ function reducer(state, action, previousState, instance) {
if (action.type === actions.toggleRowSelected) {
const { id, value: setSelected } = action
const { rowsById, selectSubRows = true, getSubRows } = instance

// Join the ids of deep rows
// to make a key, then manage all of the keys
// in a flat object
const isSelected = state.selectedRowIds[id]
const shouldExist =
typeof setSelected !== 'undefined' ? setSelected : !isSelected
Expand Down

0 comments on commit 1d92c6d

Please sign in to comment.