diff --git a/src/components/elements/Inputs/ConditionalInput/ConditionalInput.tsx b/src/components/elements/Inputs/ConditionalInput/ConditionalInput.tsx index 3c97a3170..b59b06cfd 100644 --- a/src/components/elements/Inputs/ConditionalInput/ConditionalInput.tsx +++ b/src/components/elements/Inputs/ConditionalInput/ConditionalInput.tsx @@ -48,7 +48,7 @@ const ConditionalInput = (props: ConditionalInputProps) => { values[fieldChildren.name]?.length > 0 && field.value == null ) { - field.onChange(true); + field.onChange(fieldChildren.conditional_default); } }); if (field.value == null) { diff --git a/src/components/extensive/WizardForm/types.ts b/src/components/extensive/WizardForm/types.ts index f08ac91d5..4bae2b82a 100644 --- a/src/components/extensive/WizardForm/types.ts +++ b/src/components/extensive/WizardForm/types.ts @@ -39,6 +39,7 @@ interface FormFieldBase { placeholder?: string; condition?: boolean; feedbackRequired?: boolean; + conditional_default?: boolean; } type FieldProps = Omit; diff --git a/src/helpers/customForms.ts b/src/helpers/customForms.ts index edc947569..72f782224 100644 --- a/src/helpers/customForms.ts +++ b/src/helpers/customForms.ts @@ -180,6 +180,7 @@ export const apiFormQuestionToFormField = ( placeholder: question.placeholder, validation, condition: question.show_on_parent_condition, + conditional_default: question.conditional_default, feedbackRequired };