From 45522f456e8d84966fbe0640fb0ce18094e7ef19 Mon Sep 17 00:00:00 2001 From: Kacper Date: Mon, 9 May 2022 13:44:10 +0200 Subject: [PATCH] Allow to use select with radio buttons for boolean field type --- .../client/src/components/app/forms/optionsParser.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/client/src/components/app/forms/optionsParser.js b/packages/client/src/components/app/forms/optionsParser.js index e670ccb076..bd69967731 100644 --- a/packages/client/src/components/app/forms/optionsParser.js +++ b/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 }