react-checkbox-tree
react-checkbox-tree copied to clipboard
All nodes are checked on filter
Describe the bug Hello, I have got troubles when I filter the nodes with the search bar. All the checkboxes are checked are can't be unchecked, until filterText il cleared
Reproduction steps
Tried with your FilterExample.js
Expected behavior
Any checked checkboxes, excepting if they are presents in checked state
Also, leaves are shown as a parent folder after filtering. Part of the problem is here:
https://github.com/jakezatecky/react-checkbox-tree/blob/815285ca077c36c8797f55fcec9bcb7542731cb1/src/js/NodeModel.js#L165-L167
And here: https://github.com/jakezatecky/react-checkbox-tree/blob/815285ca077c36c8797f55fcec9bcb7542731cb1/src/js/CheckboxTree.js#L195-L199
.every acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns true. Leaves with an empty "children" property will be displayed as checked.
