@@ -84,6 +84,7 @@ export const useReferenceInputController = <RecordType extends RaRecord = any>(
8484 pageInfo,
8585 isFetching : isFetchingPossibleValues ,
8686 isLoading : isLoadingPossibleValues ,
87+ isPaused : isPausedPossibleValues ,
8788 isPending : isPendingPossibleValues ,
8889 error : errorPossibleValues ,
8990 refetch : refetchGetList ,
@@ -112,6 +113,7 @@ export const useReferenceInputController = <RecordType extends RaRecord = any>(
112113 error : errorReference ,
113114 isLoading : isLoadingReference ,
114115 isFetching : isFetchingReference ,
116+ isPaused : isPausedReference ,
115117 isPending : isPendingReference ,
116118 } = useReference < RecordType > ( {
117119 id : currentValue ,
@@ -128,6 +130,7 @@ export const useReferenceInputController = <RecordType extends RaRecord = any>(
128130 // The reference query isn't enabled when there is no value yet but as it has no data, react-query will flag it as pending
129131 ( currentValue != null && currentValue !== '' && isPendingReference ) ||
130132 isPendingPossibleValues ;
133+ const isPaused = isPausedPossibleValues || isPausedReference ;
131134
132135 // We need to delay the update of the referenceRecord and the finalData
133136 // to the next React state update, because otherwise it can raise a warning
@@ -176,7 +179,8 @@ export const useReferenceInputController = <RecordType extends RaRecord = any>(
176179 hideFilter : paramsModifiers . hideFilter ,
177180 isFetching : isFetchingReference || isFetchingPossibleValues ,
178181 isLoading : isLoadingReference || isLoadingPossibleValues ,
179- isPending : isPending ,
182+ isPaused,
183+ isPending,
180184 page : params . page ,
181185 perPage : params . perPage ,
182186 refetch,
0 commit comments