Open samirotiv opened 8 months ago
@jameskerr hey, can we get some attention here and merge a fix asap? This is a critical issue that needs to be solved.
It is reproducible on provided Demos, best visible on: https://react-arborist.netlify.app/cities on "Selected Items:" card counter
Up
Agree that this package should take care of this, but just noting that it's pretty easy to implement this when you have your own Node
type:
function CustomNode({
tree,
node,
style,
}: NodeRendererProps<MyCustomTreeItem>) {
// You can access tree.props.onSelect and do tree.props.onSelect(tree.selectedNodes) after a deselect
}
Here is the bug demonstration:
https://github.com/user-attachments/assets/1aaa9ac7-b551-447d-9b75-556dce2f6985
On lines 341 to 345, there is a missing call to fire the
tree.onSelect
callback. This is preventing me from getting an updated list of selected nodes on deselection. I am using checkboxes for my implementation.This needs to be: