mui-x
mui-x copied to clipboard
[TreeView] Allow to define indentation at the item level [WIP]
Deploy preview: https://deploy-preview-13126--material-ui-x.netlify.app/
Generated by :no_entry_sign: dangerJS against 984f50db21f06713990046d014417a7cb6eefde0
This pull request has conflicts, please resolve those before we can evaluate the pull request.
Do we want the items to always have the style defined regardless of the flag state?
I only added it when the flag is enabled for TreeItem2 but forgot the check on TreeItem, I'll fix it
It does not seem to work (be reflected) on the headless API
This demo sets a custom padding on TreeItem2Content.
It's not using the flag so everything should work fine, but if you enable it, you end up with a flag tree since the padding we put is overridden.
Not sure how to handle that one...
Either we say that this demo is not using the feature so it's fine (maybe adding a small note below the demo to make it clear)
Or we enable the flag on this demo and adapt the padding accordingly.
Or we add a new div inside CustomTreeItemContent just to add the padding on another element than the one used internally for indentation when the flag is enabled.
This is super specific to our doc though, in a real application, people are either using the flag or not using it, they will never try to create a Tree View that supports both.
P.S. It would be nice to have this feature/prop documented somehwere, but I take it that you plan to do it together with the drag&drop feature?
I was planning on doing a follow up with the indentPerLevel prop extracted from the drag&drop PR and some doc for both the experimental feature and the new prop.
Without the new prop, the experimental feature is limited when you try to customize.