Skip to content
Source
Sign inSign up
TanStack/table

Pinning aggregation rows then ungrouping causes a hard error #5822

ClosedMike-Dax(GitHub profile, opens in a new tab) opened this issue 0 comments

TanStack Table version

8.20.5

Framework/Library version

React 17.0.2

Describe the bug and the steps to reproduce it

This reproduction is a combination of the pinning and grouping example sandboxes.

  1. Group some rows, eg 'last names' by clicking ✋.
  2. Pin a grouped aggregation row by clicking ⬆️ or ⬇️.
  3. Ungroup the rows by clicking ✊.

In this code:

https://github.com/TanStack/table/blob/6b4d616dd7c8917616eb4fecaf09dda7030fd115/packages/table-core/src/features/RowPinning.ts#L233-L247C30

table.getRow(rowId, true) is called on an aggregation row that no longer exists, and the component errors ungracefully.

https://stackblitz.com/edit/tanstack-table-s94mcy?file=src%2Fmain.tsx

Screenshots or Videos (Optional)

No response

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

Yes, I am also opening a PR that solves the problem along side 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.
  1. KevinVandy closed this

Sign in to join this conversation.