From 69b84fec8f19ac3fcee78bec5182709eaf93d4b4 Mon Sep 17 00:00:00 2001 From: Andre Pereira Date: Fri, 13 Oct 2023 14:19:01 +0100 Subject: [PATCH] Tempo: Fix empty values in TraceQL filters (#76544) Fix empty values in TraceQL filters --- .../datasource/tempo/SearchTraceQLEditor/SearchField.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/datasource/tempo/SearchTraceQLEditor/SearchField.tsx b/public/app/plugins/datasource/tempo/SearchTraceQLEditor/SearchField.tsx index d8b4a741ce1..01424057f17 100644 --- a/public/app/plugins/datasource/tempo/SearchTraceQLEditor/SearchField.tsx +++ b/public/app/plugins/datasource/tempo/SearchTraceQLEditor/SearchField.tsx @@ -81,7 +81,9 @@ const SearchField = ({ setError, query, ]); - if (filter.value && options && !options.find((o) => o === filter.value)) { + + // Add selected option if it doesn't exist in the current list of options + if (filter.value && !Array.isArray(filter.value) && options && !options.find((o) => o.value === filter.value)) { options.push({ label: filter.value.toString(), value: filter.value.toString(), type: filter.valueType }); }