-
-
Notifications
You must be signed in to change notification settings - Fork 94
Adding interactions to a tree node. #13
-
Hey I'm trying to develop a hierarchical tree structure using the package react-complex-tree https://github.com/lukasbach/react-complex-tree.
I'm using multiple trees in my project and the template for nodes in the first tree is different from the others. I tried and added buttons against each node to prepare some interactions like deleting the node and more. The problem here comes after that, when ever I drag and drop a node the onClick() function for that button gets triggered. I don't understand why this is happening, can anyone help me with this?
Also I want to set a depth limit to the tree, any ideas how I can achieve that?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
You could try to implement your own InteractionMode to have better control over events do what (see https://rct.lukasbach.com/docs/guides/interaction-modes). Do you have an example for that?
Regarding the depth limit, you could for example use a custom data provider, and in the ondidChangeTreeData
method conditionally decide whether you want to allow the action or not (see https://rct.lukasbach.com/docs/guides/custom-data-provider).
Beta Was this translation helpful? Give feedback.