Skip to content

Commit

Permalink
πŸ› discriminate 'required' and 'initial' message
Browse files Browse the repository at this point in the history
Initial message (explaining where to find the CAU)
was not shown initially, just the required error
'CAU must be filled'.
Now the required error is shown only after
the field has been visited.
  • Loading branch information
vokimon committed Oct 24, 2024
1 parent 0dc9161 commit 5776c86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/containers/Contract/SelfConsumptionDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ const SelfConsumptionDetails = (props) => {
onChange={handleChangeCAU}
onBlur={handleBlur}
error={
values?.self_consumption?.cau && !!errors?.self_consumption?.cau
touched?.self_consumption?.cau && !!errors?.self_consumption?.cau
}
helperText={
errors?.self_consumption?.cau || (
(!!values?.self_consumption?.cau && errors?.self_consumption?.cau) || (
<a
href={t('SELFCONSUMPTION_CAU_HELP_URL')}
target="_blank"
Expand Down

0 comments on commit 5776c86

Please sign in to comment.