Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parentId or getParentRow is undefined for grouped data (flat data + grouping column) #4881

Open
2 tasks done
csantos1113 opened this issue May 26, 2023 · 0 comments · May be fixed by #4882
Open
2 tasks done

parentId or getParentRow is undefined for grouped data (flat data + grouping column) #4881

csantos1113 opened this issue May 26, 2023 · 0 comments · May be fixed by #4882

Comments

@csantos1113
Copy link

Describe the bug

parentId and getParentRow returns undefined for leafRows that are grouped by a given column

Your minimal, reproducible example

https://codesandbox.io/s/row-grouping-forked-pg5nco

Steps to reproduce

  1. Go to https://codesandbox.io/s/row-grouping-forked-pg5nco
  2. Expand/Collapse the "single" status
  3. Notice the parentId is undefined and the getParentRow in the console is undefined too

Expected behavior

I expected the parentId to reference the "virtual" aggregatedGroupedRow tanstack table creates internally.

How often does this bug happen?

Every time

Screenshots or Videos

Screenshot 2023-05-26 at 11 19 05 AM

Platform

  • OS: all
  • Browser: all

react-table version

v8.9.1

TypeScript version

N/A

Additional context

I think because tanstack table is creating a "virtual/fake" row for the grouping, that row id should be assigned to its subRows so we don't lose its parenting references

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant