fixes bug with zero-based radio values

This commit is contained in:
James
2020-09-12 22:55:18 -04:00
parent ad483da837
commit 7b3cefd4ef

View File

@@ -169,7 +169,7 @@ const optionsToValidatorMap = {
},
radio: (value, options = {}) => {
const stringValue = String(value);
if ((value || !options.required) && (options.options.find((option) => String(option.value) === stringValue))) return true;
if ((typeof value !== 'undefined' || !options.required) && (options.options.find((option) => String(option.value) === stringValue))) return true;
return defaultMessage;
},
blocks: (value, options) => {