Comcast / Comcast/react-data-grid
Updating selectedRows property on onRowClick event stops double click from working
- Dominant language
- TypeScript
- Stars
- 7.7k
- Forks
- 2.2k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 33
Description
I have a data grid setup like following:
``` html
```
I want to set selected rows on row click and not on checkbox click:
``` javascript
const [selectedRows, setSelectedRows] = useState>(() => new Set());
```
``` javascript
function rowClickHandler(row: any) {
let selectedRowsSet = new Set(selectedRows);
if (selectedRowsSet.has(row.id)) {
selectedRowsSet.delete(row.id);
} else {
selectedRowsSet.add(row.id);
}
setSelectedRows(selectedRowsSet);
}
```
But the above function disables functionality for double click to edit cell. I think it may be due to the state change that occurs when I call the `setSelectedRows` function to update selected row.
Is there any way in which I can click rows for selection and double click for cell edit to work ?
Contributor guide
Assessment
This issue has not been assessed yet.