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

Grouping causes rows count to increase #325

Open
1 task done
misiek08 opened this issue May 5, 2024 · 1 comment
Open
1 task done

Grouping causes rows count to increase #325

misiek08 opened this issue May 5, 2024 · 1 comment
Labels
V1 Issue with MRT V1

Comments

@misiek08
Copy link

misiek08 commented May 5, 2024

mantine-react-table version

v1.3.4

react & react-dom versions

v17.0.2

Describe the bug and the steps to reproduce it

  1. Open https://www.mantine-react-table.com/docs/guides/aggregation-and-grouping#aggregation-grouping-example
  2. See 298 as row count in table.
  3. Remove grouping by state (default).
  4. Footer now says there are 250 rows.

For me this is a bug, because we have 250 rows of data in table and counting grouping rows is misleading. Let's assume orders table, where you group by client and now you have more orders than really were received.

// if this is accepted as a bug I can try to send PR fixing it. I didn't look into code yet.

Minimal, Reproducible Example - (Optional, but Recommended)

Official grouping/agg example at https://www.mantine-react-table.com/docs/guides/aggregation-and-grouping#aggregation-grouping-example

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

  • I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
@alessandrojcm alessandrojcm added the V1 Issue with MRT V1 label May 7, 2024
@misiek08
Copy link
Author

misiek08 commented Jun 5, 2024

I'm not sure, but probably something like
getPrePaginationRowModel().flatRows.filter(r => !r.getIsGrouped()).length here could help.

Don't know if it's safe, will try to work with this in some spare time, but maybe this will help someone with more knowledge to push PR faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V1 Issue with MRT V1
Projects
None yet
Development

No branches or pull requests

2 participants