Open AggarwalShipra opened 4 years ago
Yes, it is a unfortunately a current issue.
کص ننت با این پکیجت دیوث فارسی نوشتم حالیت نشه
We are still facing the same issue.Is there any temporary fix for this.The parent node is considered as child and able to toggle the checkbox,but the css of the child nodes are applied(for which having children:[]).
When we create a node and define children array as an empty array the node is treated as parent node but does not have any child now when we try to toggle selection for this node it does not work.
According to code: The node is not getting toggled because in the code we have a toggledChecked function and if a node is parent node and does not have any child node it is not getting toggled at all as it is returning false for all the conditions in this function. As per the code, it is working fine but the node should get toggle. So I think it is a bug in code if children array is [] the node should not be treated as a parent or if it is to be treated as a parent the code for toggling should be fixed.
And maybe It is due to this issue only that we get the issue in the selection of nodes after filtering result because due to recursion the children is set as [] for nodes and their selection don't work
Reproduction steps when defining the nodes for checkbox tree just pass children : [] for one of the nodes, and you will notice that you won't be able to toggle the selection.
Code Fix To fix this code for my use case I tried changing the code to treat node as leaf node if children: []
Could you please confirm if this is an issue because I don't think it is expected behavior. As we are not able to toggle the checkbox if the child array is empty.