diff --git a/app/components/app/person/family-parents-form.vue b/app/components/app/person/family-parents-form.vue index 8c41a3c8..fddb5ecb 100644 --- a/app/components/app/person/family-parents-form.vue +++ b/app/components/app/person/family-parents-form.vue @@ -33,13 +33,14 @@ watch( (newValue) => { if (!formRef.value) return - const currentFamilies = formRef.value.values?.families || [] - if (newValue === '1') { isFamilyFormDisabled.value = false - // CREATE MODE — Auto default - if (!isEditing.value && currentFamilies.length === 0) { + const fam = formRef.value.values?.families || [] + + const needsReset = fam.length !== 2 || fam[0]?.relation !== 'mother' || fam[1]?.relation !== 'father' + + if (needsReset) { formRef.value.setFieldValue('families', [ { relation: 'mother', name: '', education: '', occupation: '' }, { relation: 'father', name: '', education: '', occupation: '' }, @@ -51,9 +52,7 @@ watch( isFamilyFormDisabled.value = true - if (!isEditing.value) { - formRef.value.setFieldValue('families', []) - } + formRef.value.setFieldValue('families', []) }, { immediate: true }, ) @@ -105,7 +104,7 @@ watch( class="space-y-4 rounded-lg border border-gray-200 bg-gray-50/50 p-4 dark:border-gray-700 dark:bg-gray-800/50" >