Skip to content

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

Open
@ldeveber

Description

@ldeveber

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions