lukasbach / react-complex-tree

Unopinionated Accessible Tree Component with Multi-Select and Drag-And-Drop
https://rct.lukasbach.com
MIT License
982 stars 82 forks source link

Hide arrow if all children are moved #188

Closed ZekiJohn closed 1 year ago

ZekiJohn commented 1 year ago

How can I hide the dropdown arrow if every last one of a child is moved out.

Shaglock commented 1 year ago

Whether arrow is shown or not depends only on isFolder (previously hasChildren) prop of the node. So you have to change that property for the node when all children are moved out.

I agree that this is not very intuitive and probably would be better if it was just checking current state of item and not isFolder property. Maybe this could be done with custom renderItemArrow renderer.

Check this discussion https://github.com/lukasbach/react-complex-tree/pull/70

ZekiJohn commented 1 year ago

ok Thanks Shaglock 🙏🏾