From 6b6b69ae0950b9fefdad2f40512933aa18a057bb Mon Sep 17 00:00:00 2001 From: Katherine Date: Mon, 17 Jun 2024 16:31:59 +0800 Subject: [PATCH] fix: restore field height spacing after removing description in form (#4679) --- .../antd/form-item/FormItem.tsx | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/form-item/FormItem.tsx b/packages/core/client/src/schema-component/antd/form-item/FormItem.tsx index c4055e3221..3eb65f08e1 100644 --- a/packages/core/client/src/schema-component/antd/form-item/FormItem.tsx +++ b/packages/core/client/src/schema-component/antd/form-item/FormItem.tsx @@ -65,15 +65,17 @@ export const FormItem: any = withDynamicSchemaProps( const showTitle = schema['x-decorator-props']?.showTitle ?? true; const extra = useMemo(() => { - return typeof field.description === 'string' ? ( -
'), - }} - /> - ) : ( - field.description - ); + if (field.description && field.description !== '') { + return typeof field.description === 'string' ? ( +
'), + }} + /> + ) : ( + field.description + ); + } }, [field.description]); const className = useMemo(() => { return cx(formItemWrapCss, {