fix(gif): prevent suggestion list flicker with keepPreviousData
When the throttled autocomplete query changes, React Query briefly returns undefined for the new key, causing the suggestion list to flash hidden then visible. keepPreviousData holds the old suggestions until the new response arrives. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -94,6 +94,7 @@ export function useKlipyAutocompleteQuery(
|
||||
queryFn: () => fetchKlipyAutocomplete(query),
|
||||
enabled: query.length > 0 && options?.enabled !== false,
|
||||
staleTime: STALE.HOURS.ONE,
|
||||
placeholderData: keepPreviousData,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user