Skip to content

Commit

Permalink
fix(comp:tree): indeterminateKeys shouldn't check disabled state (#1373)
Browse files Browse the repository at this point in the history
  • Loading branch information
sallerli1 committed Dec 23, 2022
1 parent de416c1 commit 0607e5c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/components/tree/src/composables/useCheckable.ts
Expand Up @@ -55,20 +55,15 @@ export function useCheckable(props: TreeProps, mergedNodeMap: ComputedRef<Map<VK
}

const indeterminateKeySet = new Set<VKey>()
const disabledKeys = checkDisabledKeys.value
const nodeMap = mergedNodeMap.value
_checkedKeys.forEach(key => {
const { parentKey } = nodeMap.get(key) || {}
if (!isNil(parentKey)) {
let parent = nodeMap.get(parentKey)
if (parent && !_checkedKeys.includes(parent.key)) {
if (!disabledKeys.includes(parentKey)) {
indeterminateKeySet.add(parentKey)
}
indeterminateKeySet.add(parentKey)
while (parent && !isNil(parent.parentKey)) {
if (!disabledKeys.includes(parent.parentKey)) {
indeterminateKeySet.add(parent.parentKey)
}
indeterminateKeySet.add(parent.parentKey)
parent = nodeMap.get(parent.parentKey)
}
}
Expand Down

0 comments on commit 0607e5c

Please sign in to comment.