mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -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[]) => {
|
onChangeMetrics = (values: string[], selectedOptions: CascaderOption[]) => {
|
||||||
let query;
|
let query;
|
||||||
if (selectedOptions.length === 1) {
|
if (selectedOptions.length === 1) {
|
||||||
if (selectedOptions[0].children.length === 0) {
|
const selectedOption = selectedOptions[0];
|
||||||
query = selectedOptions[0].value;
|
if (!selectedOption.children || selectedOption.children.length === 0) {
|
||||||
|
query = selectedOption.value;
|
||||||
} else {
|
} else {
|
||||||
// Ignore click on group
|
// Ignore click on group
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user