question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ReferenceInput -> AutocompleteArrayInput - item disappears visually after choosing

See original GitHub issue

What 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): 2020-03-11-21-24-disappearing

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:

Peek 2020-03-11 21-37

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:closed
  • Created 4 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
erkhem42commented, Aug 25, 2020

This is fixed in v3.

@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 sure

tag_issue

1reaction
fzaninottocommented, Mar 12, 2020

This 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found