Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: supplement maxCount logic for complicated cases #602

Merged
merged 13 commits into from
Dec 24, 2024
Prev Previous commit
Next Next commit
chore: remove conductCheck
aojunhao123 committed Dec 9, 2024
commit 8f476756de6687e1c3b9574e197e4e5f2fceefb7
4 changes: 1 addition & 3 deletions src/OptionList.tsx
Original file line number Diff line number Diff line change
@@ -13,7 +13,6 @@ import type { DataNode, FieldNames, Key, SafeKey } from './interface';
import { getAllKeys, isCheckDisabled } from './utils/valueUtil';
import { useEvent } from 'rc-util';
import { formatStrategyValues } from './utils/strategyUtil';
import { conductCheck } from 'rc-tree/lib/utils/conductUtil';

const HIDDEN_STYLE = {
width: 0,
@@ -210,9 +209,8 @@ const OptionList: React.ForwardRefRenderFunction<ReviseRefOptionListProps> = (_,
// calculate disabled state
const selectableNodeKeys = getSelectableKeys(node, fieldNames);
const simulatedCheckedKeys = [...checkedKeys, ...selectableNodeKeys];
const { checkedKeys: conductedKeys } = conductCheck(simulatedCheckedKeys, true, keyEntities);
const simulatedDisplayValues = formatStrategyValues(
conductedKeys as SafeKey[],
simulatedCheckedKeys as SafeKey[],
showCheckedStrategy,
keyEntities,
fieldNames,