Skip to content

Commit

Permalink
HAI-1586 Add missing index, add should validate, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pitkni committed Sep 21, 2023
1 parent ac138cc commit 305afd7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/domain/hanke/edit/HankeFormYhteystiedot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ const ContactField: React.FC<{

useEffect(() => {
if (inputDisabled) {
setValue(`${contactType}.0.ytunnus`, null);
setValue(`${contactType}.${index}.ytunnus`, null, {
shouldValidate: true,
});
}
}, [inputDisabled]);

Expand Down Expand Up @@ -261,7 +263,6 @@ const HankeFormYhteystiedot: React.FC<FormProps> = () => {
<ResponsiveGrid>
{CONTACT_FIELDS.map((contactField) => {
const fieldName = `${FORMFIELD.RAKENNUTTAJAT}.${index}.${contactField}`;
index;
return (
<ContactField
key={contactField}
Expand Down

0 comments on commit 305afd7

Please sign in to comment.