mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Variables: fixes so single value picker closes dropdown on select (#22823)
This commit is contained in:
parent
2bed1bc2e7
commit
45784f58f5
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user