Browse Source
Merge pull request #5787 from Upgreydd/convert_text_to_boolean_for_custom_schema_in_select
Allow to use select for boolean field type
pull/5961/head
Martin McKeaveney
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
0 deletions
-
packages/client/src/components/app/forms/optionsParser.js
|
|
|
@ -40,6 +40,15 @@ export const getOptions = ( |
|
|
|
|
|
|
|
// Extract custom options
|
|
|
|
if (optionsSource === "custom" && customOptions) { |
|
|
|
customOptions.forEach(option => { |
|
|
|
if (typeof option.value === "string") { |
|
|
|
if (option.value.toLowerCase() === "true") { |
|
|
|
option.value = true |
|
|
|
} else if (option.value.toLowerCase() === "false") { |
|
|
|
option.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
return customOptions |
|
|
|
} |
|
|
|
|
|
|
|
|