ReferenceInput -> AutocompleteArrayInput - item disappears visually after choosing
See original GitHub issueWhat you were expecting:
When using an <AutocompleteArrayInput>
inside a <ReferenceInput>
, and typing for autocomplete, the chosen item should stay visible in the UI choices.
What happened instead:
The item disappears visually (but no in the actual store):
Steps to reproduce:
Creating this layout reproduces the bug:
<SimpleForm resource={RESOURCE_NAME}>
<ReferenceInput
source="externalId"
reference={RESOURCE_NAME}
filterToQuery={searchText => ({
_q_name: searchText
})}
>
<AutocompleteArrayInput optionValue="externalId" label="" />
</ReferenceInput>
</SimpleForm>
Where RESOURCE_NAME is defined under the main <Admin> component and this SimpleForm is on another screen. It seems like the input is trying to insert a value that it cannot find after choosing the value.
This also happens with <AutocompleteInput>
.
When choosing from the initial list without typing, it works fine:
Environment
- React-admin version: 2.9.0
- Last version that did not exhibit the issue (if applicable): -
- React version: ^16.12.0
- Browser: Google Chrome Version 80.0.3987.132 (Official Build) (64-bit)
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Developers - ReferenceInput - item disappears visually after choosing
What you were expecting: When using an <AutocompleteArrayInput> inside a <ReferenceInput> , and typing for autocomplete, the chosen item should stay visible ...
Read more >AutocompleteArrayInput displays blank entries - Stack Overflow
I had the same issue - turns out I was using a ReferenceInput when I should've been using a ReferenceArrayInput . i.e. <ReferenceInput...
Read more >The AutocompleteArrayInput Component - React-admin
To let users choose multiple values in a list using a dropdown with autocompletion, use <AutocompleteArrayInput> . It renders using MUI Autocomplete.
Read more >react-admin: Versions | Openbase
Full version history for react-admin including change logs.
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
@fzaninotto The issue is still there in
3.8.2
. When you type in autocomplete input (<AutocompleteArrayInput> inside a <ReferenceInput>), the previous selected items are disappeared. IMO it’s because suggestion list don’t include the previous items, so the previous selected item names are disappeared. But i’m not sureThis is fixed in v3. If someone from the community wants to fix this in v2, then please open a PR. Otherwise, we’ll close this issue within a few months.