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

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

Open ldeveber opened this issue 2 years ago • 7 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

ldeveber avatar Jul 07 '21 15:07 ldeveber

Thanks for the report.

jakezatecky avatar Jul 08 '21 15:07 jakezatecky

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

ldeveber avatar Jul 12 '21 19:07 ldeveber

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 .

ItayBa avatar Dec 05 '21 13:12 ItayBa

@jakezatecky any update on this?

anmohanty123 avatar Apr 26 '22 20:04 anmohanty123

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

zhr1130 avatar Oct 07 '22 17:10 zhr1130

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 avatar Oct 07 '22 20:10 jakezatecky

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

sandeep-07 avatar Dec 12 '23 06:12 sandeep-07