Updating selectedRows property on onRowClick event stops double click from working
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Start by reproducing the behavior with the DataGrid configuration and rowClickHandler shown in the issue, focusing on the interaction between selectedRows updates and double-click cell editing. Trace the DataGrid row-click and edit entry points; done means selecting a row on click no longer prevents double-clicking a cell to edit it.
Written by the indexing model from the issue text.
Description
I have a data grid setup like following:
<DataGrid
rowKeyGetter={rowKeyGetter}
columns={columns}
rows={rows}
onRowsChange={setRows}
selectedRows={selectedRows}
onSelectedRowsChange={setSelectedRows}
rowRenderer={RowRenderer}
onSelectedCellChange={selectedCellChange}
onRowClick={rowClickHandler}
rowHeight={30}
></DataGrid>
I want to set selected rows on row click and not on checkbox click:
const [selectedRows, setSelectedRows] = useState<Set<number>>(() => new Set());
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 ?
- Dominant language
- TypeScript
- Stars
- 7.7k
- Forks
- 2.2k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 30
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Comcast/react-data-grid
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Comcast/react-data-grid#4045 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Comcast/react-data-grid#4184 ·
-
Comcast/react-data-grid#4120 · 1 comment · 1 assignee ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
Comcast/react-data-grid#4004 · 4 comments ·
-
Pinned Rows API Open
Difficulty 5/5 Over a week Newbie friendliness 35/100
Comcast/react-data-grid#3940 ·
All issues in Comcast/react-data-grid
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·