ColumnGrouping.getDefaultColumnDef should not return aggregatedCell
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 28.4k
- Forks
- 3.6k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 10
Description
TanStack Table version
v8.20.5
Framework/Library version
v18.3.1
Describe the bug and the steps to reproduce it
flexRender(cell.column.columnDef.aggregatedCell ?? cell.column.columnDef.cell, cell.getContext()) becomes meaningless because then aggregatedCell is not defined, the default aggregatedCell return from ColumnGrouping.getDefaultColumnDef is used.
- Open the following CodeSandbox
- Click status to group status column
- Profile Progress show
49.995466826778745, expected to be Profile Progress show50%
Temporal solution: use null or undefined:
{
accessorKey: 'progress',
header: 'Profile Progress',
cell: ({ getValue }) =>
Math.round(getValue<number>() * 100) / 100 + '%',
aggregationFn: 'mean',
aggregatedCell: null,
// aggregatedCell: ({ getValue }) =>
// Math.round(getValue<number>() * 100) / 100 + '%',
}
or
defaultColumn:{
aggregatedCell: undefined,
}
but it looks weird and unnecessary.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
None
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
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 React grouping CodeSandbox and trace ColumnGrouping.getDefaultColumnDef alongside the flexRender call described in the report. Reproduce the grouped progress display, then verify that the expected 50% formatting is preserved without explicitly setting aggregatedCell.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100