fix: cursor resetting in dropdown causing wrong query selection (#5063)

This commit is contained in:
Vikrant Gupta 2024-05-23 22:43:11 +05:30 committed by GitHub
parent 93babc3019
commit da74619a46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -126,6 +126,7 @@ export const useAutoComplete = (
isExist,
results,
result,
isFetching,
whereClauseConfig,
);

View File

@ -23,6 +23,7 @@ export const useOptions = (
isExist: boolean,
results: string[],
result: string[],
isFetching: boolean,
whereClauseConfig?: WhereClauseConfig,
): Option[] => {
const [options, setOptions] = useState<Option[]>([]);
@ -138,6 +139,9 @@ export const useOptions = (
if (newOptions.length > 0) {
setOptions(newOptions);
}
if (isFetching) {
setOptions([]);
}
}, [
whereClauseConfig,
getKeyOpValue,
@ -154,6 +158,7 @@ export const useOptions = (
searchValue,
getKeyOperatorOptions,
getOptionsWithValidOperator,
isFetching,
]);
return useMemo(