mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 13:39:19 -06:00
Fix PromQuery cascader when selected option has no children (#23835)
This commit is contained in:
parent
e18e4cf015
commit
47c6bd6963
@ -199,8 +199,9 @@ class PromQueryField extends React.PureComponent<PromQueryFieldProps, PromQueryF
|
||||
onChangeMetrics = (values: string[], selectedOptions: CascaderOption[]) => {
|
||||
let query;
|
||||
if (selectedOptions.length === 1) {
|
||||
if (selectedOptions[0].children.length === 0) {
|
||||
query = selectedOptions[0].value;
|
||||
const selectedOption = selectedOptions[0];
|
||||
if (!selectedOption.children || selectedOption.children.length === 0) {
|
||||
query = selectedOption.value;
|
||||
} else {
|
||||
// Ignore click on group
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user