From b64ce6a2b346c4abf38e76d5a17a86786dee7396 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Wed, 14 Jun 2023 10:56:45 +0800 Subject: [PATCH] fix: default value for multiple select cannot be set (#2031) --- .../core/client/src/schema-component/antd/select/Select.tsx | 5 ++++- 1 file changed, 4 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 4b76ca32b..0da2cb018 100644 --- a/packages/core/client/src/schema-component/antd/select/Select.tsx +++ b/packages/core/client/src/schema-component/antd/select/Select.tsx @@ -88,7 +88,10 @@ const InternalSelect = connect( } const toValue = (v) => { if (['tags', 'multiple'].includes(props.mode) || props.multiple) { - return toArr(v); + if (v) { + return toArr(v); + } + return undefined; } return v; };