TanStack / TanStack/table

Grouping by not using subRows

Open
#5,594 3 comments 0 reactions 0 assignees View on GitHub

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

8.17.3

Framework/Library version

React v18.2.0

Describe the bug and the steps to reproduce it

Not sure if a bug of if it's intended behavior but the grouping feature doesn't seem to look at values in subRows.
Please check the codesandbox below. I'd expect to have "John (4)", and to actually have all rows and subRows grouped by firstName but only the top-level rows are grouped by firstName.

If this is intended behavior, a consequence is that firstName in the subRows is empty and misleading (e.g. "John Hey" shows up under "James" but only "Hey" is visible). Still, in case this is still intended behavior, how could this be avoided so the table groups by a column in all rows and subRows?

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

On the sandbox below, click on the "First Name" group icon first, and then on the button "Toggle expand all" button below the table. This way we ensure the table is grouped by firstName and all rows are expanded.

https://codesandbox.io/p/sandbox/sharp-meninsky-766zsz?file=%2Fsrc%2FApp.tsx%3A62%2C26

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox at src/App.tsx around line 62 and reproduce the grouping and expand-all steps. Trace how grouping handles the top-level rows versus subRows and compare the result with the expected “John (4)” behavior. Done means the intended behavior is established and either grouping correctly includes subRows or the limitation and reliable workaround are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.