react-checkbox-tree icon indicating copy to clipboard operation
react-checkbox-tree copied to clipboard

All nodes are checked on filter

Open chumarie opened this issue 5 years ago • 1 comments

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

Screenshots Image from Gyazo

chumarie avatar Mar 31 '20 18:03 chumarie

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.

javiercaceres avatar Apr 15 '20 15:04 javiercaceres