Skip to content

Commit 49ac823

Browse files
committed
fix: Merge branch 'htomo1122-fix/checkbox-half-checked-state' into dev
2 parents 29a021a + fbc6465 commit 49ac823

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/tree-utils/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ export function makeTreeProcessor<T>(data: T[], opt: Options = {}) {
156156
this.stats!,
157157
(stat) => {
158158
if (stat.children && stat.children.length > 0) {
159-
const checked = stat.children.every((v) => v.checked);
159+
const allChecked = stat.children.every((v) => v.checked === true);
160+
const allUnchecked = stat.children.every((v) => v.checked === false);
161+
const checked = allChecked ? true : allUnchecked ? false : 0;
160162
if (stat.checked !== checked) {
161163
this._ignoreCheckedOnce(stat);
162164
stat.checked = checked;

0 commit comments

Comments
 (0)