You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i would argue that row.subRows?.length is not supposed to be there.
look:
as we can see, aggregated cells exists even if no subrows exists for this group. this happens on custom getGroupedRowModel that i implement that makes sure that certain grouping values always exists even if there is no current rows for them(full explanation).
this is not a bug, but rather would say unexpected behavior for the method cell.getIsAggregated. i would argue that at least the next major release should change this behavior.
in my case, checking for row.depth === 0 instead is enough:
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?
Yes, I think I know how to fix it and will discuss it in the comments of this issue
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.
The text was updated successfully, but these errors were encountered:
TanStack Table version
table-core v8.17.3
Framework/Library version
react
Describe the bug and the steps to reproduce it
current implementation for
cell.getIsAggregated
istable/packages/table-core/src/features/ColumnGrouping.ts
Line 396 in 22e1ac4
i would argue that
row.subRows?.length
is not supposed to be there.look:
as we can see, aggregated cells exists even if no subrows exists for this group. this happens on custom getGroupedRowModel that i implement that makes sure that certain grouping values always exists even if there is no current rows for them(full explanation).
this is not a bug, but rather would say unexpected behavior for the method
cell.getIsAggregated
. i would argue that at least the next major release should change this behavior.in my case, checking for
row.depth === 0
instead is enough: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?
Yes, I think I know how to fix it and will discuss it in the comments of this issue
Terms & Code of Conduct
The text was updated successfully, but these errors were encountered: