Treeview and Selection #3698
-
I implemented a treeView based on the following code: I added some keyboard navigation for expand/collapse and changed behavior of So my code looks the following:
But now when selecting with the mouse the node is selected and immediately deselected!! I also would like to select childs programmatically when a parent is selected. I tried in the
But that ended up in an unpredictable behavior (I guess due to asynchronus status-update?). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Quick glance, I think you've doubled/tripled up on some listeners, you've sent itemProps into usePress and spread the result on the outer most Box, but then you've also spread itemProps again on the next Box, and then it's again spread onto the Box for expanded. Try breaking some of that up into more specific handlers. You can call usePress multiple times if needed. |
Beta Was this translation helpful? Give feedback.
Quick glance, I think you've doubled/tripled up on some listeners, you've sent itemProps into usePress and spread the result on the outer most Box, but then you've also spread itemProps again on the next Box, and then it's again spread onto the Box for expanded.
Try breaking some of that up into more specific handlers. You can call usePress multiple times if needed.