-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[TreeView] Add publicAPI
method to disable items
#16743
base: master
Are you sure you want to change the base?
Conversation
Deploy preview: https://deploy-preview-16743--material-ui-x.netlify.app/ Updated pages: |
packages/x-tree-view/src/internals/plugins/useTreeViewItems/useTreeViewItems.tsx
Outdated
Show resolved
Hide resolved
packages/x-tree-view/src/internals/plugins/useTreeViewItems/useTreeViewItems.tsx
Outdated
Show resolved
Hide resolved
packages/x-tree-view/src/internals/plugins/useTreeViewItems/useTreeViewItems.types.ts
Outdated
Show resolved
Hide resolved
docs/data/tree-view/rich-tree-view/items/DisableTreeItemPublicAPI.tsx
Outdated
Show resolved
Hide resolved
packages/x-tree-view/src/internals/plugins/useTreeViewItems/useTreeViewItems.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super nice new feature 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can add a few basic tests it would be awesome 🙏
I'm proposing to add a
publicAPI
method to the Tree View, to allow users to imperatively disable an item. A very common use case is when you have a lock icon, and the item is disabled/enabled when clicking on it.Discovered the need for this while working on #16744