Skip to content

Commit

Permalink
fix: checkbox field validation
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Aug 24, 2021
1 parent b589f44 commit 532caae
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,15 @@ const View = ({ data, id, path }) => {
subblock.required &&
additionalField &&
!additionalField?.isValid(formData, name)
)
) {
v.push(name);
} else if (
subblock.required &&
fieldType === 'checkbox' &&
!formData[name]?.value
) {
v.push(name);
else if (
} else if (
subblock.required &&
(!formData[name] ||
formData[name]?.value?.length === 0 ||
Expand Down

0 comments on commit 532caae

Please sign in to comment.