Skip to content

Commit f1aedba

Browse files
committed
feat: support validation of required boolean values
1 parent 6cc7131 commit f1aedba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

components/Formsy/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ Formsy.addValidationRule('isRequired', (values, value, array) => { // eslint-dis
4949
return value.trim().length > 0
5050
}
5151

52+
// we treat any boolean value as value is set
53+
if (_.isBoolean(value)) {
54+
return true
55+
}
56+
5257
// if some unexpected type of `value` has been passed, treat as not provided
5358
return false
5459
})

0 commit comments

Comments
 (0)