mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
This commit is contained in:
parent
bff9671b81
commit
9aac0d32f9
@ -36,8 +36,8 @@ export function LabelFilterItem({
|
||||
isLoadingLabelValues?: boolean;
|
||||
}>({});
|
||||
|
||||
const isMultiSelect = () => {
|
||||
return operators.find((op) => op.label === item.op)?.isMultiValue;
|
||||
const isMultiSelect = (operator = item.op) => {
|
||||
return operators.find((op) => op.label === operator)?.isMultiValue;
|
||||
};
|
||||
|
||||
const getSelectOptionsFromString = (item?: string): string[] => {
|
||||
@ -94,7 +94,11 @@ export function LabelFilterItem({
|
||||
width="auto"
|
||||
onChange={(change) => {
|
||||
if (change.value != null) {
|
||||
onChange({ ...item, op: change.value } as unknown as QueryBuilderLabelFilter);
|
||||
onChange({
|
||||
...item,
|
||||
op: change.value,
|
||||
value: isMultiSelect(change.value) ? item.value : getSelectOptionsFromString(item?.value)[0],
|
||||
} as unknown as QueryBuilderLabelFilter);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user