diff --git a/src/EditModel/form-helpers/validateFields.js b/src/EditModel/form-helpers/validateFields.js index 4d321f783..526401fd6 100644 --- a/src/EditModel/form-helpers/validateFields.js +++ b/src/EditModel/form-helpers/validateFields.js @@ -10,7 +10,7 @@ const isRequiredField = field => get('isRequired', field.fieldOptions) === true; const isDirtyField = field => field.value; -const isRequiredOrDirtyField = field => isRequiredField(field) || isDirtyField(field); +const isRequiredOrDirtyField = field => !field.hiddenComponent && (isRequiredField(field) || isDirtyField(field)); const validateField = (field, formRef, formRefStateClone) => { const validateResult = formRef.validateField(formRefStateClone, field.name, field.value); diff --git a/src/config/field-rules.js b/src/config/field-rules.js index 06c54a74a..b8912b059 100644 --- a/src/config/field-rules.js +++ b/src/config/field-rules.js @@ -509,6 +509,7 @@ export default new Map([ type: 'HIDE_FIELD', }], }, + createDefaultRuleForField('valueType', 'TEXT') ]], ['programStage', [ {