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

mol-plugin: better multiselect

parent e2b540e2
No related branches found
No related tags found
No related merge requests found
......@@ -247,12 +247,13 @@ export class MultiSelectControl extends React.PureComponent<ParamProps<PD.MultiS
</div>
</div>
<div className='msp-control-offset' style={{ display: this.state.isExpanded ? 'block' : 'none' }}>
{this.props.param.options.map(([value, label]) =>
<div key={value} className='msp-row'>
{this.props.param.options.map(([value, label]) => {
const sel = current.indexOf(value) >= 0;
return <div key={value} className='msp-row'>
<button onClick={this.toggle(value)} disabled={this.props.isDisabled}>
{current.indexOf(value) >= 0 ? `✓ ${label}` : `${label}`}
<span style={{ float: sel ? 'left' : 'right' }}>{sel ? `✓ ${label}` : `${label} ✗`}</span>
</button>
</div>)}
</div> })}
</div>
</>;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment