From 91116938040cb63228f75c99346298c4eaa668b3 Mon Sep 17 00:00:00 2001 From: Junyi Date: Thu, 20 Oct 2022 22:39:52 +0800 Subject: [PATCH] fix(plugin-workflow): fix collection fieldset component (#942) --- .../workflow/src/client/components/CollectionFieldset.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/plugins/workflow/src/client/components/CollectionFieldset.tsx b/packages/plugins/workflow/src/client/components/CollectionFieldset.tsx index a04d1f0d1..e9aca4759 100644 --- a/packages/plugins/workflow/src/client/components/CollectionFieldset.tsx +++ b/packages/plugins/workflow/src/client/components/CollectionFieldset.tsx @@ -40,6 +40,8 @@ export default observer(({ value, onChange }: any) => { // && (!['linkTo', 'hasMany', 'hasOne', 'belongsToMany'].includes(field.type)) )); + const fieldsSet = new Set(fields.map(field => field.name)); + return (
{ ); }) } - {Object.keys(value).length < fields.length + {Object.keys(value).filter(key => fieldsSet.has(key)).length < fields.length ? ( onChange({ ...value, [key]: null })} className={css`