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

[tree view] Support for enabling checkboxes only for leaf nodes #13586

Closed
Skykingeagle opened this issue Jun 4, 2024 · 7 comments
Closed

[tree view] Support for enabling checkboxes only for leaf nodes #13586

Skykingeagle opened this issue Jun 4, 2024 · 7 comments
Labels
component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! new feature New feature or request status: waiting for author Issue with insufficient information

Comments

@Skykingeagle
Copy link

Skykingeagle commented Jun 4, 2024

Reference: #12883

While the parent / children selection relationship works with the checkBoxSelectionProp

Would there be any way to restrict the checkboxes for only leaf nodes?

Add a restriction for checkboxes to only appear on leaf nodes

Search keywords:

Search keywords:

@github-actions github-actions bot added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jun 4, 2024
@zannager zannager added the component: checkbox This is the name of the generic UI component, not the React module! label Jun 5, 2024
@ZeeshanTamboli ZeeshanTamboli transferred this issue from mui/material-ui Jun 22, 2024
@michelengelen
Copy link
Member

Hey @Skykingeagle ... I'll add this to the board for the team to have a look!
I guess this could be possible, but I'd like the teams opinion on that first.

@michelengelen michelengelen changed the title Support for enabling checkboxes only for leaf nodes [tree view] Support for enabling checkboxes only for leaf nodes Jun 24, 2024
@michelengelen michelengelen added new feature New feature or request component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer component: checkbox This is the name of the generic UI component, not the React module! labels Jun 24, 2024
@flaviendelangle
Copy link
Member

You can achieve this a custom TreeItem component, here is a basic implementation

Let me know if this solves your problem

@flaviendelangle flaviendelangle added the status: waiting for author Issue with insufficient information label Jul 16, 2024
Copy link

The issue has been inactive for 7 days and has been automatically closed.

@TheRealCuran
Copy link

@flaviendelangle thanks for the example! We're using it like that too, but really dislike the any escape hatch usage in slotProps={{ checkbox: { visible: !status.expandable } as any }}. Is there a chance to get this properly typed and maybe supported a bit more elegantly out of the box?

In case it helps with prioritisation: we're a paying customer, our latest order number is 💳 #84512.

@michelengelen
Copy link
Member

@flaviendelangle thanks for the example! We're using it like that too, but really dislike the any escape hatch usage in slotProps={{ checkbox: { visible: !status.expandable } as any }}. Is there a chance to get this properly typed and maybe supported a bit more elegantly out of the box?

In case it helps with prioritisation: we're a paying customer, our latest order number is 💳 #84512.

Hey @TheRealCuran ... could you open up a new ticket for that? We try to separate and track individually to better plan and implement in small batches! Thank you! 👍🏼

@TheRealCuran
Copy link

@michelengelen see #15674 for the new ticket. Though I think we could have done this here? Less cluttering can be very helpful too, for finding issues again.

@flaviendelangle
Copy link
Member

The problem with re-using old issues is that we tend to diverge from the original topic and end up with an issue that is very hard to understand.

If the reason the keep discussing is not that the fix does not work at all, we tend to prefer opening new issues 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! new feature New feature or request status: waiting for author Issue with insufficient information
Projects
None yet
Development

No branches or pull requests

6 participants