From ea04d2309ec28a0fb95eb10014dd42c5c63f6daa Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Wed, 31 May 2023 16:55:52 +0800 Subject: [PATCH] fix: select toValue (#1962) * fix: select toValue * fix: select toValue --- .../client/src/schema-component/antd/select/Select.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/core/client/src/schema-component/antd/select/Select.tsx b/packages/core/client/src/schema-component/antd/select/Select.tsx index ce75629e39..72ad91a37e 100644 --- a/packages/core/client/src/schema-component/antd/select/Select.tsx +++ b/packages/core/client/src/schema-component/antd/select/Select.tsx @@ -79,6 +79,12 @@ const InternalSelect = connect( if (objectValue) { return ; } + const toValue = (v) => { + if (['tags', 'multiple'].includes(props.mode) || props.multiple) { + return toArr(v); + } + return v; + }; return ( : } - value={value?value:undefined} + value={toValue(value)} {...others} onChange={(changed) => { props.onChange?.(changed === undefined ? null : changed);