Skip to content

Commit 549af03

Browse files
authored
Merge pull request #5731 from marmelab/Fix-ReferenceInput-does-not-show-loaded-while-data-is-loading
Fix ReferenceInput does not show loader while possible values and reference record are loading
2 parents 127a968 + 82c04da commit 549af03

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/ra-core/src/controller/input/ReferenceInputController.spec.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ describe('<ReferenceInputController />', () => {
216216
choices: [{ id: 1 }],
217217
error: null,
218218
filter: { q: '' },
219-
loading: false,
219+
loading: true,
220220
pagination: { page: 1, perPage: 25 },
221221
sort: { field: 'title', order: 'ASC' },
222222
warning: null,

packages/ra-core/src/controller/input/useReferenceInputController.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export const useReferenceInputController = (
199199
// kept for backwards compatibility
200200
// @deprecated to be removed in 4.0
201201
error: dataStatus.error,
202-
loading: dataStatus.waiting,
202+
loading: !possibleValuesLoaded || !referenceLoaded,
203203
filter: filterValues,
204204
setFilter,
205205
pagination,

0 commit comments

Comments
 (0)