Selecting an item in ReferenceArrayInput does get
See original GitHub issueWhat you were expecting:
No GET request
What happened instead:
A GET request
Steps to reproduce:
I have a relatively simple form:
import * as React from 'react';
import { Create, SimpleForm, TextInput, ReferenceArrayInput, SelectArrayInput } from 'react-admin';
const resourceSort = { field: 'resource', direction: 'asc' };
export const RoleCreate = (props: any) => (
<Create {...props}>
<SimpleForm>
<TextInput source="name" />
<ReferenceArrayInput source="permissions" reference="permissions" sort={resourceSort}>
<SelectArrayInput optionText="action" />
</ReferenceArrayInput>
</SimpleForm>
</Create>
);
After selecting an item in the dropdown a GET request is performed to:
Request URL: http://localhost:5201/api/permissions?id=69437072-89a2-496c-ade8-3970e7cd0841
I see no reason for this since we already have a list.
Related code:
In steps to reproduce.
Other information:
Environment
- React-admin version: 4.0.0-rc.0
- React version: 17.0.2
- Browser: Chrome
Additional
Bonus question: I also notice that <Edit /> sends both the ids and the objects. Is this on purpose? Can I disable one or the other? See screenshot for what I mean. This is after updating a permission id.

Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:17 (15 by maintainers)
Top Results From Across the Web
The ReferenceArrayInput Component - React-admin - Marmelab
Use <ReferenceArrayInput> to edit an array of reference values, i.e. to let users choose a list of values (usually foreign keys) from another...
Read more >Is there any way to show pre-selected items in the react ...
When clicked the ReferenceArrayInput -> SelectArrayInput component on the ui, it does show all the record-related items (coming from client ...
Read more >useSelect | Downshift
A custom select element can be created with HTML elements such as: label, ul, li and button. Using other HTML elements to create...
Read more >marmelab - Bountysource
sanitizeEmptyValues will insert null value in object when removing an array item ... when there is more than one item already selected, the...
Read more >methods and apparatuses for providing a reference array ...
The reference array input device can include a plurality of indicator detectors adapted to facilitate selection of a corresponding instruction associated ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi! We will try to include an improvement for this in the next minor release (4.1.0), but I can’t guarantee it, since the fix will probably not be trivial and require some time and thinking through to deal with the underlying react-query behaviour.
@ZachSelindh I’d assume that if there were updates they’d be added here.
Another option is to try and fix it yourself. It sounds pretty important to you, so it’s worth spending time on.