-
Couldn't load subscription status.
- Fork 42
Open
Description
for example.
node's partial selected status.
- L1 (got false, wanted true)
- L1.1 true
- L1.1.1 checked
- L1.1.2 not checked
according to this code snippet
// nodePartialSelected 判断节点的半选中状态
func nodePartialSelected(trees []Tree) bool {
selectedNum := 0
for _, v := range trees {
if v.Selected {
selectedNum++
}
}
if selectedNum == len(trees) || selectedNum == 0 {
// 子节点全选中,或一个也没有选中
return false
}
return true
}Proposed code snippet.
When we saw one partial selected is true, return true imediately.
// nodePartialSelected 判断节点的半选中状态
func nodePartialSelected(trees []Tree) bool {
selectedNum := 0
for _, v := range trees {
if v.PartialSelected {
return true
}
if v.Selected {
selectedNum++
}
}
if selectedNum == len(trees) || selectedNum == 0 {
// 子节点全选中,或一个也没有选中
return false
}
return true
}Metadata
Metadata
Assignees
Labels
No labels