diff --git a/packages/components/src/components/form/ItemControl.tsx b/packages/components/src/components/form/ItemControl.tsx index 28f1aa34e7..89ab5b6e13 100644 --- a/packages/components/src/components/form/ItemControl.tsx +++ b/packages/components/src/components/form/ItemControl.tsx @@ -44,6 +44,7 @@ const ItemControl: React.FC = (props: Props) => { ) : null; const icon = customIcon || innerIcon; + const innerHasFeedback = feedback && feedback.length > 0; return (
@@ -52,7 +53,7 @@ const ItemControl: React.FC = (props: Props) => { {icon} {afterInput}
-
+
{help &&
{help}
} {feedback && feedback.length > 0 && ( diff --git a/packages/components/src/components/form/style/index.less b/packages/components/src/components/form/style/index.less index cb4a7acb12..3c7ecea9c4 100644 --- a/packages/components/src/components/form/style/index.less +++ b/packages/components/src/components/form/style/index.less @@ -37,6 +37,10 @@ display: flex; margin-bottom: @field-gap; + &:last-child { + margin-bottom: 0; + } + .@{form-prefix-cls}-large & { margin-bottom: @field-gap-large; } @@ -95,7 +99,6 @@ } &-message { - margin-top: @margin-xs; color: @info-color; font-size: @size-font-12; } @@ -103,6 +106,7 @@ &-feedback, &-help { min-height: @field-gap; + margin-top: @margin-xs; .@{form-prefix-cls}-large & { min-height: @field-gap-large; diff --git a/packages/website/src/components/functional/form/demo/expand.tsx b/packages/website/src/components/functional/form/demo/expand.tsx index 0e74a8ba9d..4f6d116fc8 100644 --- a/packages/website/src/components/functional/form/demo/expand.tsx +++ b/packages/website/src/components/functional/form/demo/expand.tsx @@ -28,6 +28,7 @@ const Expand: React.FC = () => { visible={visible} title="新建账号" style={{ width: 360 }} + bodyStyle={{ minHeight: 370 }} onClose={() => setVisible(false)} onOk={() => setVisible(false)} > @@ -42,7 +43,7 @@ const Expand: React.FC = () => { - {expand && (