Skip to content

Commit

Permalink
fix: radio component validation trigger (#1916)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonat75 committed Dec 12, 2023
1 parent dcf9f31 commit 5f02cd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/app/src/components/RHF/RadioOuiNon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ export const RadioOuiNon = ({ legend, name, disabled, triggerValidation = false
value: "oui",
...field,
onChange: e => {
field.onChange(e); // Inform RHF to update its state.
if (triggerValidation) {
trigger(); // Rerun validation to set isValid and errors.
}
field.onChange(e); // Inform RHF to update its state.
},
},
},
Expand All @@ -40,10 +40,10 @@ export const RadioOuiNon = ({ legend, name, disabled, triggerValidation = false
value: "non",
...field,
onChange: e => {
field.onChange(e); // Inform RHF to update its state.
if (triggerValidation) {
trigger(); // Rerun validation to set isValid and errors.
}
field.onChange(e); // Inform RHF to update its state.
},
},
},
Expand Down

0 comments on commit 5f02cd5

Please sign in to comment.