Note: for support questions, please use stackoverflow. This repository's issues are reserved for feature requests and bug reports.
Report a bug
- What is the current behavior?
In the sandbox demo provided, clicking the "Animal" checkbox should cause the Dog checkbox to become checked. Right now, only the Cat checkbox and its children become checked.
Open the demo and click the checkbox next to Animal
- What is the expected behavior?
The Dog check box should be checked.
- What is the motivation / use case for changing the behavior?
That's how trees are supposed to work.
-
Please tell us about your environment:
- Version: 2.0.0-beta.X
- Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
- Language: [all | TypeScript X.X | ES6/7 | ES5 | Dart]
-
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
To fix it, you should modify function updateChildNodeStatus
. There is a statement: const currentNode = {...item, checked, };
which temporarily sets the checked state of Dog, but this is later overridden by the nodeUpdate triggered in the computed filteredData. If you instead mutate the item by adding: item.checked = checked;
after this line it appears to correct the problem. However, I should note that when testing this fix, I was passing a reactive tree object, so I'm not positive this will fix the behavior in your demo.