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

mol-plugin: tweaked Select invalid option

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