jakezatecky / react-checkbox-tree

A simple and elegant checkbox tree for React.

Home Page:https://jakezatecky.github.io/react-checkbox-tree/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

checking an item with a filter will clear any items that are not visible

ldeveber opened this issue · comments

Describe the bug
Please include a clear and concise description of what the bug is.

With an implementation similar to: https://github.com/jakezatecky/react-checkbox-tree/blob/master/examples/src/js/FilterExample.js

Select a bunch of nodes, and then search and check one. The selection gets cleared to whats visible.

I guess the second issue is the demo I copy pasted doesn't totally work either as leafs suddenly show as parents when searching:

Screen Shot 2021-07-07 at 11 39 16 AM

Screen Shot 2021-07-07 at 11 38 50 AM

Reproduction steps
Please include the necessary steps to reproduce the issue as well as a live example that showcases it. You can modify this CodeSandbox reference point to create a working example.

https://codesandbox.io/embed/react-checkbox-tree-example-forked-jh73o?fontsize=14&hidenavigation=1&theme=dark

  1. select a bunch of nodes
  2. search for something
  3. select something

EXPECTED: the node from step 3 should be added to the collection of selected nodes from step 1

ACTUAL: only the nodes visible from the search on step 2 are selected

Expected behavior
Please include a clear and concise description of what you expected to happen.

nodes that were selected before searching should remain selected

Screenshots
If applicable, add screenshots to help explain your problem.

ACTUAL BEHAVIOR: nodes get cleared on search

Thanks for the report.

I forgot to mention this broke on upgrading from 1.6 to 1.7.1! I did not try 1.7.0.

happens to me too .
The problem seem to be happening on the onCheck callback on a filtered tree.
The component remembers the last checked state (filter and unfilter without checking will show you that)
, but onCheck callback will not return the filtered tree state .

@jakezatecky any update on this?

@jakezatecky , would you take a look at this bug please ? We are currently blocked from using 1.7 and up version :(

I have been knocking out issues on another project with my limited time, but I intend to shift gears back to this component soon.

@jakezatecky any update on this issue . We are using this component in our production environement and occuring loss of time