Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Prevent all node to be checked when filtering tree #202

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.

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

Successfully merging this pull request may close these issues.

5 participants