mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
3.92k stars 1.19k forks source link

[TreeView] Add inline node name editing #10112

Open bharatkashyap opened 10 months ago

bharatkashyap commented 10 months ago

Summary 💡

A tree item would be able to be renamed inline, through a double-click-to-edit workflow (possibly).

Examples 🌈

https://github.com/mui/mui-x/assets/19550456/3916df8d-e440-4242-b06b-ddbe4bffcb5d

flaviendelangle commented 10 months ago

I'm wondering if editing is compatible with the current DOM API (passing the children as components instead of passing a prop with an array of objects like the rows on the datagrid. But we will probably have the same problem with virtualization anyway.

So the first step is probably to change the API to something like <TreeView items={[...]} /> Which is a MASSIVE breaking change and will reduce a lot the customizability of the component...

oliviertassinari commented 7 months ago

@bharatkashyap Do you need this feature to be built-in or where you looking for an example. I wonder if an example could be simple enough for developers.

bharatkashyap commented 7 months ago

@bharatkashyap Do you need this feature to be built-in or where you looking for an example. I wonder if an example could be simple enough for developers.

Agree, perhaps an example is sufficient enough instead of supporting APIs to do this out of the box

flaviendelangle commented 7 months ago

We discussed this with Jose yesterday We will try to do a recipe first and we'll see if it's viable :+1: