CE-551 Fix, only do formik ErrorMessage when inForm

This commit is contained in:
2023-07-25 16:15:45 -05:00
parent 555e50689a
commit ee7d224ba2

View File

@ -320,11 +320,14 @@ function DynamicSelect({tableName, processName, fieldName, overrideId, fieldLabe
/>
)}
/>
<Box mt={0.75}>
<MDTypography component="div" variant="caption" color="error" fontWeight="regular">
{!isDisabled && <div className="fieldErrorMessage"><ErrorMessage name={fieldName} render={msg => <span data-field-error="true">{msg}</span>} /></div>}
</MDTypography>
</Box>
{
inForm &&
<Box mt={0.75}>
<MDTypography component="div" variant="caption" color="error" fontWeight="regular">
{!isDisabled && <div className="fieldErrorMessage"><ErrorMessage name={fieldName} render={msg => <span data-field-error="true">{msg}</span>} /></div>}
</MDTypography>
</Box>
}
</Box>
);