diff --git a/package.json b/package.json index c213034b..70b5e9cc 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "@babel/runtime": "^7.12.5", "array-tree-filter": "^2.1.0", "classnames": "^2.3.1", + "rc-select": "~13.2.1", "rc-tree-select": "~4.8.0", "rc-trigger": "^5.0.4", "rc-util": "^5.6.1", diff --git a/src/util.ts b/src/util.ts index 31985cd6..2db1897b 100644 --- a/src/util.ts +++ b/src/util.ts @@ -7,6 +7,7 @@ import type { InternalDataNode, OptionDataNode, } from './interface'; +import { toArray } from 'rc-select/lib/utils/commonUtil'; const VALUE_SPLIT = '__RC_CASCADER_SPLIT__'; @@ -53,7 +54,7 @@ export function isLeaf(option: OptionDataNode) { * zombieJ: It's better to deprecate the same key in the nest tree. Maybe next major version. */ export function connectValue(value: React.Key[]) { - return (value || []).join(VALUE_SPLIT); + return toArray(value).join(VALUE_SPLIT); } /**