Skip to content
Snippets Groups Projects
Commit 1b377eae authored by David Sehnal's avatar David Sehnal
Browse files

mol-plugin: Fixed a bug in Select param control

parent 993d8139
No related branches found
No related tags found
No related merge requests found
......@@ -221,7 +221,7 @@ export class SelectControl extends SimpleParam<PD.Select<string | number>> {
}
renderControl() {
const isInvalid = this.props.value !== void 0 && !this.props.param.options.some(e => e[0] === this.props.value);
return <select value={this.props.value || this.props.param.defaultValue} onChange={this.onChange} disabled={this.props.isDisabled}>
return <select value={this.props.value !== void 0 ? this.props.value : this.props.param.defaultValue} onChange={this.onChange} disabled={this.props.isDisabled}>
{isInvalid && <option key={this.props.value} value={this.props.value}>{`[Invalid] ${this.props.value}`}</option>}
{this.props.param.options.map(([value, label]) => <option key={value} value={value}>{label}</option>)}
</select>;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment