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

customize keyboard bindings #293

Closed Lueton closed 9 months ago

Lueton commented 9 months ago

First of all thank you for your awesome work, i love this package!

To my feature request/question: Is it possible to disable or overwrite the logic of keyboardBindings? I want the selectAll keybinding to select only items within the same parent and the same level of depth.

Is there any way to do this so far?

Thanks :)

Lueton commented 9 months ago

Well i solved it by overwriting the binding with:

keyboardBindings={{
    selectAll: ["THIS_IS_DISABLED"],
}}

and introducing a custom event handler on the document wich interacts with the environment ref.