mirror of
https://github.com/grafana/grafana.git
synced 2026-07-30 08:18:10 -05:00
Variables: fixes so single value picker closes dropdown on select (#22823)
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user