11import { useEffect , useMemo } from 'react'
22import { createLogger } from '@sim/logger'
3- import { keepPreviousData , useInfiniteQuery , useQueries , useQuery } from '@tanstack/react-query'
3+ import { useInfiniteQuery , useQueries , useQuery } from '@tanstack/react-query'
44import { extractEnvVarName , isEnvVarReference , isReference } from '@/executor/constants'
55import { usePersonalEnvironment } from '@/hooks/queries/environment'
66import { getSelectorDefinition , mergeOption } from '@/hooks/selectors/registry'
@@ -84,8 +84,6 @@ export function useSelectorOptions(
8484 definition . fetchList ?.( { ...queryArgs , signal } ) ?? Promise . resolve ( [ ] ) ,
8585 enabled : ! supportsPagination && isEnabled ,
8686 staleTime : definition . staleTime ?? DEFAULT_SELECTOR_STALE_TIME ,
87- /** `search` is part of the key, so without this the open dropdown empties on every edit. */
88- placeholderData : keepPreviousData ,
8987 } )
9088
9189 const pagedQuery = useInfiniteQuery < SelectorPage > ( {
@@ -102,8 +100,6 @@ export function useSelectorOptions(
102100 initialPageParam : undefined as string | undefined ,
103101 enabled : supportsPagination && isEnabled ,
104102 staleTime : definition . staleTime ?? DEFAULT_SELECTOR_STALE_TIME ,
105- /** Same reason as the flat query: the key carries `search`. */
106- placeholderData : keepPreviousData ,
107103 } )
108104
109105 const { hasNextPage, isFetchingNextPage, fetchNextPage, isError } = pagedQuery
0 commit comments