fix: restore field height spacing after removing description in form (#4679)

This commit is contained in:
Katherine 2024-06-17 16:31:59 +08:00 committed by GitHub
parent 6a751b596f
commit 6b6b69ae09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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' ? (
<div
dangerouslySetInnerHTML={{
__html: HTMLEncode(field.description).split('\n').join('<br/>'),
}}
/>
) : (
field.description
);
if (field.description && field.description !== '') {
return typeof field.description === 'string' ? (
<div
dangerouslySetInnerHTML={{
__html: HTMLEncode(field.description).split('\n').join('<br/>'),
}}
/>
) : (
field.description
);
}
}, [field.description]);
const className = useMemo(() => {
return cx(formItemWrapCss, {