Commit 45784f58 by Hugo Häggmark Committed by GitHub

Variables: fixes so single value picker closes dropdown on select (#22823)

parent 2bed1bc2
......@@ -39,11 +39,17 @@ export class OptionsPickerUnconnected extends PureComponent<Props> {
onHideOptions = () => this.props.commitChangesToVariable();
onToggleOption = (option: VariableOption, clearOthers: boolean) => {
this.props.toggleOption({
option,
clearOthers,
forceSelect: false,
});
const toggleFunc = this.props.variable.multi ? this.onToggleMultiValueVariable : this.onToggleSingleValueVariable;
toggleFunc(option, clearOthers);
};
onToggleSingleValueVariable = (option: VariableOption, clearOthers: boolean) => {
this.props.toggleOption({ option, clearOthers, forceSelect: false });
this.onHideOptions();
};
onToggleMultiValueVariable = (option: VariableOption, clearOthers: boolean) => {
this.props.toggleOption({ option, clearOthers, forceSelect: false });
};
render() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment