Skip to content

Prevent all node to be checked when filtering tree #202

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dpellier
Copy link

See #196

There is a strange behaviour for the leaf node.

On first render, there are correctly set as a leaf with a children: undefined property.

But after filtering, they got a children: [] prop.

Thus the isLeaf value is set wrong (which you can see on the filter example, when filtering the leaf suddenly get a directory icon).
And it also changes the returned values of the checked function, checking everything (even if the actual checked state is still untouched).

@MaxwellKendall
Copy link

MaxwellKendall commented May 4, 2020

@dpellier @jakezatecky I am also having this bug.

I've confirmed this branch fixes the issue. 🙏

Opened a PR on your branch to update breaking tests: dpellier#2

@olessiap
Copy link

olessiap commented May 5, 2020

yess, so pumped there's a fix already in place for this one!

@vjr12
Copy link

vjr12 commented Jul 23, 2020

@jakezatecky this issue still persists. Merge the PR?

@jalalazimi
Copy link

Hi friends, Please check out #217 .
Replace filtered.push({ ...node, children }); with filtered.push({...node, ...children.length && {children}});. Temporary you can use this solution to fix the above issue.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants