Add ability to deselect a function

was previously impossible to do through the UI
pull/1622/head
Alex P 2017-06-19 16:25:51 -07:00
parent 2e80f6d350
commit d2000224f8
1 changed files with 7 additions and 2 deletions

View File

@ -38,8 +38,13 @@ class FunctionSelector extends Component {
}
onSingleSelect(item) {
this.props.onApply([item])
this.setState({localSelectedItems: [item]})
if (item === this.state.localSelectedItems[0]) {
this.props.onApply([])
this.setState({localSelectedItems: []})
} else {
this.props.onApply([item])
this.setState({localSelectedItems: [item]})
}
}
isSelected(item) {