mirror of
https://github.com/gosticks/react-table.git
synced 2025-10-16 11:55:36 +00:00
Fix row.toggleExpanded(bool) (#1732)
The wrong variable was being checked against `undefined`, so the row was always being toggled, rather than taking the parameter into account.
This commit is contained in:
parent
2955335df1
commit
8dc6559e64
@ -42,7 +42,7 @@ function reducer(state, action) {
|
||||
const { path, expanded } = action
|
||||
const key = path.join('.')
|
||||
const exists = state.expanded.includes(key)
|
||||
const shouldExist = typeof set !== 'undefined' ? expanded : !exists
|
||||
const shouldExist = typeof expanded !== 'undefined' ? expanded : !exists
|
||||
let newExpanded = new Set(state.expanded)
|
||||
|
||||
if (!exists && shouldExist) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user