From d2000224f8510f09db58a2f2666a8c3f5a675219 Mon Sep 17 00:00:00 2001 From: Alex P Date: Mon, 19 Jun 2017 16:25:51 -0700 Subject: [PATCH] Add ability to deselect a function was previously impossible to do through the UI --- ui/src/shared/components/FunctionSelector.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/src/shared/components/FunctionSelector.js b/ui/src/shared/components/FunctionSelector.js index 7f0d9b4be..75be5eb5a 100644 --- a/ui/src/shared/components/FunctionSelector.js +++ b/ui/src/shared/components/FunctionSelector.js @@ -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) {