primefaces / primefaces/primereact
DataTable - Frozen rows + CellSelection:"single" - when selecting a cell, two are highlighted
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 8.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
DataTable - Frozen rows + CellSelection:"single" when we click and selecting one cell, two are highlighted, one from frozen column, another from value in dataTable
DataTable props:
<DataTable
value={customers}
frozenValue={lockedCustomers}
cellSelection
selectionMode="single"
selection={selectedCell}
onSelectionChange={(e) => setSelectedCell(e.value)}
scrollable
scrollHeight="400px"
tableStyle={{ minWidth: '50rem' }}
dataKey="id"
>
Test sandbox
https://stackblitz.com/edit/o1ch7jx7?file=src%2FApp.jsx
Reproducer
https://stackblitz.com/edit/o1ch7jx7?file=src%2FApp.jsx
System Information
"primereact": "latest",
"react": "18.3.1",
Steps to reproduce the behavior
-In Datatable with frozen rows + cellSelection single click on frozen cell
-Frozen cel is highlited
-First "not frozen" cell is also higlited
Expected behavior
Single cell should be highlighted
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.
Research direction
Start with the linked StackBlitz reproducer and its src/App.jsx to confirm the duplicate highlight when selecting a frozen cell. Then locate the DataTable implementation handling frozen rows and cellSelection, and verify the fix by confirming that only the selected cell is highlighted in the reproducer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100