From 054a6878c50abda002bb9881dfad509c09fb28c4 Mon Sep 17 00:00:00 2001 From: vineyardbovines Date: Tue, 14 Apr 2026 15:20:29 -0400 Subject: [PATCH] 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) --- src/state/queries/klipy.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/state/queries/klipy.ts b/src/state/queries/klipy.ts index 77d7820a48..a4a5f8e753 100644 --- a/src/state/queries/klipy.ts +++ b/src/state/queries/klipy.ts @@ -94,6 +94,7 @@ export function useKlipyAutocompleteQuery( queryFn: () => fetchKlipyAutocomplete(query), enabled: query.length > 0 && options?.enabled !== false, staleTime: STALE.HOURS.ONE, + placeholderData: keepPreviousData, }) }