diff --git a/packages/ui/v2/form/fields.tsx b/packages/ui/v2/form/fields.tsx index 62e48adb65..7746a2ae82 100644 --- a/packages/ui/v2/form/fields.tsx +++ b/packages/ui/v2/form/fields.tsx @@ -55,25 +55,17 @@ function HintsOrErrors(props: { if (!hintErrors && fieldErrors && !fieldErrors.message) { // no hints passed, field errors exist and they are custom ones return ( - <> - {fieldErrors?.message && ( -
- - {fieldErrors.message} -
- )} -
- -
- +
+ +
); } @@ -107,6 +99,16 @@ function HintsOrErrors(props: { ); } + // errors exist, not custom ones, just show them as is + if (fieldErrors) { + return ( +
+ + {fieldErrors.message} +
+ ); + } + if (!hintErrors) return null; // hints passed, no errors exist, proceed to just show hints