From 2a8cc10faa4656195856483684aa7efb7ce6e7dc Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Fri, 13 Oct 2023 15:46:33 +0800 Subject: [PATCH] fix: multiple select should assigned null after clear value (#2822) --- .../antd/association-field/AssociationSelect.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/association-field/AssociationSelect.tsx b/packages/core/client/src/schema-component/antd/association-field/AssociationSelect.tsx index 464c932d4..c44559e11 100644 --- a/packages/core/client/src/schema-component/antd/association-field/AssociationSelect.tsx +++ b/packages/core/client/src/schema-component/antd/association-field/AssociationSelect.tsx @@ -124,8 +124,9 @@ const InternalAssociationSelect = observer((props: AssociationSelectProps) => { value={value || innerValue} service={service} onChange={(value) => { - setInnerValue(value); - props.onChange?.(value); + const val = value?.length !== 0 ? value : null; + setInnerValue(val); + props.onChange?.(val); }} CustomDropdownRender={addMode === 'quickAdd' && QuickAddContent} >