liquor-tree icon indicating copy to clipboard operation
liquor-tree copied to clipboard

Parent auto check not working properly with checked and disabled children

Open mariusz-jachimowicz-83 opened this issue 3 years ago • 0 comments

There is mechanism to auto check parent if all children are checked https://github.com/amsik/liquor-tree/blob/master/src/lib/Node.js#L124 It doesn't work properly if any child item is checked: true and disabled: true because it makes parent item unchecked instead of checked.

refreshIndeterminateState counts checked and disabled children items and based on that it apply checked state https://github.com/amsik/liquor-tree/blob/master/src/lib/Node.js#L151 so it works if disabled items are unchecked. But disabled items might be initially checked and in that case it doesn't work properly.

luquor-tree-checking-issue

Would be good to decide should disabled children be ignored or included while making parent checked because we also have checkDisabledChildren option so it might matter.

mariusz-jachimowicz-83 avatar Apr 07 '21 14:04 mariusz-jachimowicz-83