diff --git a/frontend/src/container/LogsSearchFilter/SearchFields/index.tsx b/frontend/src/container/LogsSearchFilter/SearchFields/index.tsx index a7228c6c45..50e2947ed2 100644 --- a/frontend/src/container/LogsSearchFilter/SearchFields/index.tsx +++ b/frontend/src/container/LogsSearchFilter/SearchFields/index.tsx @@ -47,6 +47,11 @@ function SearchFields({ } }, [parsedQuery]); + const updateFieldsQuery = (updated: QueryFields[][]): void => { + setFieldsQuery(updated); + keyPrefixRef.current = hashCode(JSON.stringify(updated)); + }; + const addSuggestedField = useCallback( (name: string): void => { if (!name) { @@ -97,7 +102,7 @@ function SearchFields({ keyPrefix={keyPrefixRef.current} onDropDownToggleHandler={onDropDownToggleHandler} fieldsQuery={fieldsQuery} - setFieldsQuery={setFieldsQuery} + setFieldsQuery={updateFieldsQuery} />