Allow null/empty values in Dropdown widget options (#3533)

This commit is contained in:
Vicky Bansal 2021-03-15 15:25:37 +05:30 committed by GitHub
parent 5acf2c3238
commit 7c994da6e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -395,9 +395,7 @@ export const VALIDATORS: Record<ValidationType, Validator> = {
const isValidOption = (option: { label: any; value: any }) =>
_.isObject(option) &&
_.isString(option.label) &&
_.isString(option.value) &&
!_.isEmpty(option.label) &&
!_.isEmpty(option.value);
!_.isEmpty(option.label);
const hasOptions = every(parsed, isValidOption);
const validOptions = parsed.filter(isValidOption);