Skip to content

Commit

Permalink
fix(cascader): optimize selection state logic and update test snapsho…
Browse files Browse the repository at this point in the history
…ts (#4951)

* fix(cascader): optimize selection state logic and update test snapshots

Closes #4874

* revert(cascader): undo changes to example

Closes #4874

* chore: update snapshot

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
msg-fobbit and github-actions[bot] authored Jan 23, 2025
1 parent 57d4b92 commit a47f50a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cascader/core/className.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ export function getNodeStatusClass(

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

const isSelected = node.checked || (multiple && !checkStrictly && node.expanded && !isLeaf);
let isSelected = node.checked || (multiple && !checkStrictly && node.expanded && !isLeaf);
// 处理单选非叶子节点的选中逻辑
if (!multiple && !checkStrictly && !isLeaf) {
isSelected = node.expanded;
}

return [
{
Expand Down

0 comments on commit a47f50a

Please sign in to comment.