Skip to content

Commit

Permalink
fix: update EditableCheckboxField to correctly handle checkbox state …
Browse files Browse the repository at this point in the history
…on submit
  • Loading branch information
bra-i-am committed Feb 17, 2025
1 parent 5a2c91d commit 7555d8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/account-settings/EditableCheckboxField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const EditableCheckboxField = (props) => {

const handleSubmit = (e) => {
e.preventDefault();
onSubmit(name, new FormData(e.target).get(name));
onSubmit(name, e.target[name].checked);

Check warning on line 49 in src/account-settings/EditableCheckboxField.jsx

View check run for this annotation

Codecov / codecov/patch

src/account-settings/EditableCheckboxField.jsx#L47-L49

Added lines #L47 - L49 were not covered by tests
};

const handleChange = (e) => {
Expand All @@ -68,7 +68,7 @@ const EditableCheckboxField = (props) => {
finalValue += `: ${userSuppliedValue}`;

Check warning on line 68 in src/account-settings/EditableCheckboxField.jsx

View check run for this annotation

Codecov / codecov/patch

src/account-settings/EditableCheckboxField.jsx#L68

Added line #L68 was not covered by tests
}

return finalValue === 'on' ? 'Yes' : 'No';
return finalValue ? 'Yes' : 'No';
};

const renderConfirmationMessage = () => {

Check warning on line 74 in src/account-settings/EditableCheckboxField.jsx

View check run for this annotation

Codecov / codecov/patch

src/account-settings/EditableCheckboxField.jsx#L74

Added line #L74 was not covered by tests
Expand Down

0 comments on commit 7555d8c

Please sign in to comment.