diff --git a/conda/js/src/components/ParameterCreate.jsx b/conda/js/src/components/ParameterCreate.jsx index 378557d5f07234c761a36cc2350c2344c48f5afc..7ae95a89cd5e91260a13e6b55b97e013f34aea1a 100644 --- a/conda/js/src/components/ParameterCreate.jsx +++ b/conda/js/src/components/ParameterCreate.jsx @@ -51,6 +51,19 @@ export default class ParameterCreate extends React.Component<Props, State> { const params = this.props.params; const updateParameter = this.props.updateParameter; + let new_param = false; + if (param.type == 'bool') + { + if(typeof(param.default) == 'string') + { + new_param = true; + } + else + { + new_param = false; + } + } + return ( <React.Fragment> <TypedField @@ -332,6 +345,12 @@ export default class ParameterCreate extends React.Component<Props, State> { <Input name={`default${ name }`} type='radio' + checked={param.default && !new_param} + value={true} + onChange={(e) => updateParameter(name, { + ...param, + default: JSON.parse(e.target.value) + })} /> True </Label> @@ -341,6 +360,12 @@ export default class ParameterCreate extends React.Component<Props, State> { <Input name={`default${ name }`} type='radio' + checked={!param.default && !new_param} + value={false} + onChange={(e) => updateParameter(name, { + ...param, + default: JSON.parse(e.target.value) + })} /> False </Label>