From 939037c1a26e21616c8a3aa9327c74e6c571406c Mon Sep 17 00:00:00 2001 From: Timothy Lai Date: Tue, 29 Sep 2020 16:37:41 -0700 Subject: [PATCH 1/2] fix(try-it-out): required boolean default value set to `--` ref: #6429 --- src/core/json-schema-components.jsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/core/json-schema-components.jsx b/src/core/json-schema-components.jsx index 421ac3fa706..4c5556f8b02 100644 --- a/src/core/json-schema-components.jsx +++ b/src/core/json-schema-components.jsx @@ -320,18 +320,16 @@ export class JsonSchema_boolean extends Component { let { getComponent, value, errors, schema, required, disabled } = this.props errors = errors.toJS ? errors.toJS() : [] let enumValue = schema && schema.get ? schema.get("enum") : null - if (!enumValue) { - // in case schema.get() also returns undefined/null - enumValue = fromJS(["true", "false"]) - } + let allowEmptyValue = !enumValue || !required + let booleanValue = !enumValue && fromJS(["true", "false"]) const Select = getComponent("Select") return (