mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-01 04:32:03 +08:00
fix: cursor resetting in dropdown causing wrong query selection (#5063)
This commit is contained in:
parent
93babc3019
commit
da74619a46
@ -126,6 +126,7 @@ export const useAutoComplete = (
|
|||||||
isExist,
|
isExist,
|
||||||
results,
|
results,
|
||||||
result,
|
result,
|
||||||
|
isFetching,
|
||||||
whereClauseConfig,
|
whereClauseConfig,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ export const useOptions = (
|
|||||||
isExist: boolean,
|
isExist: boolean,
|
||||||
results: string[],
|
results: string[],
|
||||||
result: string[],
|
result: string[],
|
||||||
|
isFetching: boolean,
|
||||||
whereClauseConfig?: WhereClauseConfig,
|
whereClauseConfig?: WhereClauseConfig,
|
||||||
): Option[] => {
|
): Option[] => {
|
||||||
const [options, setOptions] = useState<Option[]>([]);
|
const [options, setOptions] = useState<Option[]>([]);
|
||||||
@ -138,6 +139,9 @@ export const useOptions = (
|
|||||||
if (newOptions.length > 0) {
|
if (newOptions.length > 0) {
|
||||||
setOptions(newOptions);
|
setOptions(newOptions);
|
||||||
}
|
}
|
||||||
|
if (isFetching) {
|
||||||
|
setOptions([]);
|
||||||
|
}
|
||||||
}, [
|
}, [
|
||||||
whereClauseConfig,
|
whereClauseConfig,
|
||||||
getKeyOpValue,
|
getKeyOpValue,
|
||||||
@ -154,6 +158,7 @@ export const useOptions = (
|
|||||||
searchValue,
|
searchValue,
|
||||||
getKeyOperatorOptions,
|
getKeyOperatorOptions,
|
||||||
getOptionsWithValidOperator,
|
getOptionsWithValidOperator,
|
||||||
|
isFetching,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return useMemo(
|
return useMemo(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user