Skip to content

Commit c4b2e13

Browse files
committed
chore: enhance warning message
1 parent b23bfc2 commit c4b2e13

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/utils/warningPropsUtil.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,14 @@ function warningProps(props: TreeSelectProps & { searchPlaceholder?: string }) {
3636
warning(!Array.isArray(value), '`value` should not be array when `TreeSelect` is single mode.');
3737
}
3838

39-
if (maxCount && (showCheckedStrategy === 'SHOW_ALL' || showCheckedStrategy === 'SHOW_PARENT')) {
39+
if (
40+
maxCount &&
41+
((showCheckedStrategy === 'SHOW_ALL' && !treeCheckStrictly) ||
42+
showCheckedStrategy === 'SHOW_PARENT')
43+
) {
4044
warning(
4145
false,
42-
'`maxCount` not work with `showCheckedStrategy=SHOW_ALL` or `showCheckedStrategy=SHOW_PARENT`.',
46+
'`maxCount` not work with `showCheckedStrategy=SHOW_ALL` (when `treeCheckStrictly=false`) or `showCheckedStrategy=SHOW_PARENT`.',
4347
);
4448
}
4549
}

0 commit comments

Comments
 (0)