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