fix: 修复 select tree 模式值格式不正确的问题 (#3458)

Co-authored-by: 2betop <2betop.cn@gmail.com>
This commit is contained in:
吴多益 2022-01-20 17:37:54 +08:00 committed by GitHub
parent b3cd56a93f
commit 5805e52da5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,7 +128,7 @@ export class BaseTransferRenderer<
T extends OptionsControlProps = BaseTransferProps
> extends React.Component<T> {
@autobind
handleChange(value: Array<Option>, optionModified?: boolean) {
handleChange(value: Array<Option> | Option, optionModified?: boolean) {
const {
onChange,
joinValues,
@ -169,6 +169,11 @@ export class BaseTransferRenderer<
if (joinValues) {
newValue = newValue.join(delimiter || ',');
}
} else if (value) {
newValue =
joinValues || extractValue
? value[(valueField as string) || 'value']
: value;
}
(newOptions.length > options.length || optionModified) &&