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

Function getIsSomeSelected() return false when has one child #5800

Open
2 tasks done
wellingtonngallo opened this issue Nov 11, 2024 · 2 comments
Open
2 tasks done

Function getIsSomeSelected() return false when has one child #5800

wellingtonngallo opened this issue Nov 11, 2024 · 2 comments

Comments

@wellingtonngallo
Copy link

wellingtonngallo commented Nov 11, 2024

TanStack Table version

8.20.5

Framework/Library version

React 17.0.2

Describe the bug and the steps to reproduce it

Description bug

When a parent has only one node and this node is selected, function getIsSomeSelected() return all as false

Additional

See that in my object, subRow has only one item, the problem only occurs in this case. If you add one more item totaling 2 children, it works correctly

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

https://codesandbox.io/p/devbox/clhnxy?migrateFrom=yldcnv

Screenshots or Videos (Optional)

Image

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

None

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.
@tuliooov
Copy link

I've also experienced this problem

@remleduff
Copy link

My impression is that getIsSomeSelected returns false for any number of subrows if they are all selected. (getIsAllSubRowsSelected() returns true in this case).

You should be able to do row.getIsSomeSelected() || row.getIsAllSubRowsSelected() to get what you want, I think?

I've asked in discord whether adding a row.getIsAnySubRowsSelected() would be accepted.

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

No branches or pull requests

3 participants