diff --git a/sites/partners/src/components/listings/PaperListingForm/UnitForm.tsx b/sites/partners/src/components/listings/PaperListingForm/UnitForm.tsx index 8c5747de82..74ee6302da 100644 --- a/sites/partners/src/components/listings/PaperListingForm/UnitForm.tsx +++ b/sites/partners/src/components/listings/PaperListingForm/UnitForm.tsx @@ -519,15 +519,15 @@ const UnitForm = ({ onSubmit, onClose, defaultUnit, nextId, draft }: UnitFormPro errorMessage={t("errors.requiredFieldError")} validation={{ required: true }} inputProps={{ - onChange: () => { + onChange: (value) => { setValue("amiPercentage", undefined) clearErrors("amiPercentage") clearErrors("amiChart.id") ;[...Array(maxAmiHouseholdSize)].forEach((_, index) => { setValue(`maxIncomeHouseholdSize${index + 1}`, undefined) }) - if (amiChartID && !loading && amiChartsOptions) { - void fetchAmiChart() + if (value?.target?.value && !loading && amiChartsOptions) { + void fetchAmiChart(value.target.value) setIsAmiPercentageDirty(true) } },