gregnb / gregnb/mui-datatables

Select box doesn't seem to work in case that there is setState in onRowsSelect option

Open
#1,199 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.7k
Forks
906
PR merge metrics
No merged PRs in 30d

Description

Select box doesn't seem to work in case that there is setState function in onRowsSelect option
```
const options = {
responsive: 'scroll',
selectableRows: true,
expandableRows: false,
filter: false,
search: false,
sort:true,
onRowsSelect: this.onRowsSelect.bind(this)
};
```
select box doesn't seem to work in the following case

```
onRowsSelect(rowsSelected, allRows) {
this.setState({allRows});
}
```
But it's working the follow case
```
onRowsSelect(rowsSelected, allRows) {
// this.setState({allRows});
}
```

| Tech | Version |
|--------------|---------|
| Material-UI | |
| MUI-datatables | 2.14.0 |
| React | |
| browser | chrome |
| etc | |

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with MUI-datatables 2.14.0 using selectableRows, onRowsSelect, and the provided setState callback in Chrome. Trace the row-selection handling and compare it with the version that omits setState; done means selection continues to work when the callback updates component state.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.