lukasbach / react-complex-tree

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

Tree is missing `multiselect` prop #279

Closed kamilkazmierczakMtab closed 1 year ago

kamilkazmierczakMtab commented 1 year ago

Is your feature request related to a problem? Please describe. There are scenarios when someone might want to allow user to select only single item - like tree navigation

Describe the solution you'd like Provide multiselect prop that is true by default

Describe alternatives you've considered It's almost impossible to easily achieve it now. From what I found using ControlledTreeEnvironment could do the trick but that should not be necessary

lukasbach commented 1 year ago

I released a new version, in which a disableMultiselect prop is available on the uncontrolled tree environment. I didn't add it to the controlled environment, since there you have a pretty good control over how selections work anyway. Let me know if that works for you.

kamilkazmierczakMtab commented 1 year ago

It works well thank you.