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:
vineyardbovines
2026-04-14 15:20:29 -04:00
parent 5818219e08
commit 054a6878c5
+1
View File
@@ -94,6 +94,7 @@ export function useKlipyAutocompleteQuery(
queryFn: () => fetchKlipyAutocomplete(query),
enabled: query.length > 0 && options?.enabled !== false,
staleTime: STALE.HOURS.ONE,
placeholderData: keepPreviousData,
})
}