Skip to content

Commit 48daec0

Browse files
authored
fix(Cascader): refine selection logic for leaf node in single mode (#3840)
1 parent f13c352 commit 48daec0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/components/cascader/core/className.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ export function getNodeStatusClass(
4141

4242
const isDisabled = node.disabled || (multiple && (value as TreeNodeValue[]).length >= max && max !== 0);
4343

44-
const isSelected = node.checked || (multiple && !checkStrictly && node.expanded && !isLeaf);
44+
let isSelected = node.checked || (multiple && !checkStrictly && node.expanded && !isLeaf);
45+
if (!multiple && !checkStrictly && !isLeaf) {
46+
isSelected = node.expanded;
47+
}
4548

4649
return [
4750
{

0 commit comments

Comments
 (0)