Skip to content

Commit

Permalink
fix: crf checkbox support for 'on' and 'off'
Browse files Browse the repository at this point in the history
  • Loading branch information
mirovladimitrovski committed Oct 3, 2023
1 parent ad20660 commit c0d9629
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Account/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ const Account = ({ panelClassName, panelHeaderClassName, canUpdateEmail = true }
<Checkbox
key={index}
name={`consentsValues.${consent.name}`}
checked={section.values.consentsValues?.[consent.name] === true}
checked={[true, 'on'].includes(section.values.consentsValues?.[consent.name])}
onChange={section.onChange}
label={formatConsentLabel(consent.label)}
disabled={consent.required || section.isBusy}
Expand Down
2 changes: 1 addition & 1 deletion src/components/CustomRegisterField/CustomRegisterField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const CustomRegisterField: FC<Props> = ({ type, value = '', ...props }) =
case 'datepicker':
return <DateField {...props} value={value as string} />;
default:
return <Checkbox {...props} checked={value === true} />;
return <Checkbox {...props} checked={[true, 'on'].includes(value)} />;
}
};

Expand Down

0 comments on commit c0d9629

Please sign in to comment.