Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix: close dropdown after user has selected a tag (#2892)

Daman Arora3ba8ee1d2670
diff --git a/frontend/src/container/LogsSearchFilter/SearchFields/QueryBuilder/QueryBuilder.tsx b/frontend/src/container/LogsSearchFilter/SearchFields/QueryBuilder/QueryBuilder.tsx
index 4b01ba02e2..1a16349fb9 100644
--- a/frontend/src/container/LogsSearchFilter/SearchFields/QueryBuilder/QueryBuilder.tsx
+++ b/frontend/src/container/LogsSearchFilter/SearchFields/QueryBuilder/QueryBuilder.tsx
@@ -6,7 +6,7 @@ import {
QueryOperatorsMultiVal,
QueryOperatorsSingleVal,
} from 'lib/logql/tokens';
-import { useCallback, useMemo } from 'react';
+import { useCallback, useMemo, useState } from 'react';
import { useSelector } from 'react-redux';
import { AppState } from 'store/reducers';
import { ILogsReducer } from 'types/reducer/logs';
@@ -56,6 +56,8 @@ function QueryField({
onUpdate,
onDelete,
}: QueryFieldProps): JSX.Element | null {
+ const [isDropDownOpen, setIsDropDownOpen] = useState(false);
+
const {
fields: { selected },
} = useSelector<AppState, ILogsReducer>((store) => store.logs);
@@ -136,9 +138,12 @@ function QueryField({
<Select
mode="tags"
style={{ width: '100%' }}
+ open={isDropDownOpen}
onChange={(e): void => handleChange(2, e as never)}
defaultValue={(query[2] && query[2].value) || []}
notFoundContent={null}
+ onInputKeyDown={(): void => setIsDropDownOpen(true)}
+ onSelect={(): void => setIsDropDownOpen(false)}
/>
) : (
<Input