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

mol-plugin: better multiselect

parent e2b540e2
Branches
Tags
No related merge requests found
...@@ -247,12 +247,13 @@ export class MultiSelectControl extends React.PureComponent<ParamProps<PD.MultiS ...@@ -247,12 +247,13 @@ export class MultiSelectControl extends React.PureComponent<ParamProps<PD.MultiS
</div> </div>
</div> </div>
<div className='msp-control-offset' style={{ display: this.state.isExpanded ? 'block' : 'none' }}> <div className='msp-control-offset' style={{ display: this.state.isExpanded ? 'block' : 'none' }}>
{this.props.param.options.map(([value, label]) => {this.props.param.options.map(([value, label]) => {
<div key={value} className='msp-row'> const sel = current.indexOf(value) >= 0;
return <div key={value} className='msp-row'>
<button onClick={this.toggle(value)} disabled={this.props.isDisabled}> <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> </button>
</div>)} </div> })}
</div> </div>
</>; </>;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment