amsik / liquor-tree

Tree component based on Vue.js
MIT License
398 stars 94 forks source link

Parent auto check not working properly with checked and disabled children #233

Open mariusz-jachimowicz-83 opened 3 years ago

mariusz-jachimowicz-83 commented 3 years ago

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.