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] Can't use the TreeItem disabled prop in RichTreeView #14467

Closed
2u4u opened this issue Sep 3, 2024 · 3 comments
Closed

[tree view] Can't use the TreeItem disabled prop in RichTreeView #14467

2u4u opened this issue Sep 3, 2024 · 3 comments
Labels
component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it

Comments

@2u4u
Copy link

2u4u commented Sep 3, 2024

Steps to reproduce

Link to live example: (required)

Steps:

  1. Create RichTreeView with slots using TreeItem
  2. Set TreeItem disabled

Current behavior

TreeItem is not disabled

Expected behavior

TreeItem is disabled

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: RichTreeView, TreeItem

@2u4u 2u4u added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 3, 2024
@github-actions github-actions bot added the component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! label Sep 3, 2024
@michelengelen michelengelen changed the title TreeItem disabled is not working in RichTreeView [tree view] TreeItem disabled is not working in RichTreeView Sep 4, 2024
@michelengelen
Copy link
Member

I am not 100% sure about the interals, but what I could see from the code is that the disabled prop is being handled by the internal tree view state and overriding it like this might not be possible.
@flaviendelangle could you shed some light here?

@flaviendelangle
Copy link
Member

flaviendelangle commented Sep 4, 2024

You should use the isItemDisabled prop to disable items with RichTreeView
See this doc section for reference.

The goal of the RIchTreeView is to define the items and their state at the tree view level instead of the tree item level.

The TreeItem being shared between the SimpleTreeView and the RichTreeView components, it has a disabled prop which is indeed not used by the RichTreeView, this is a typing limitation I don't think we can avoid.

@flaviendelangle flaviendelangle added status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it status: waiting for author Issue with insufficient information and removed bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 4, 2024
@flaviendelangle flaviendelangle changed the title [tree view] TreeItem disabled is not working in RichTreeView [tree view] Can't use the TreeItem disabled prop in RichTreeView Sep 4, 2024
@2u4u 2u4u closed this as completed Sep 4, 2024
@github-actions github-actions bot removed the status: waiting for author Issue with insufficient information label Sep 4, 2024
Copy link

github-actions bot commented Sep 4, 2024

⚠️ This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@2u4u: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

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! status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it
Projects
None yet
Development

No branches or pull requests

3 participants