React-admin: ReferenceInput and SelectInput show an unwanted warning when using text values

Created on 2 Oct 2019  路  4Comments  路  Source: marmelab/react-admin

What you were expecting:
ReferenceInput with SelectInput should not show Associated reference no longer appears to be available. when the optionValue is a text.

What happened instead:
ReferenceInput show a helper / warning message when we using text value in <SelectInput>. The option is selected correctly in the UI, but the warning shows up and make the experience confusing.

Steps to reproduce:

  • Add a ReferenceInput and SelectInput as a children
  • In SelectInput configure optionValue with a text-only field
  • In a browser select any value in the dropdown
  • the message should shows up, but the value will be assigned correctly to the hidden field.

Related code:
CodeSandbox example to reproduce the error :
https://codesandbox.io/s/happy-williams-22bj2

Other information:
This bug doesn't raise any error but it's just giving a bad experience to the user.

Environment

  • React-admin version: 2.9.6 (but also present in 2.8.5, the version that I use)
  • Last version that did not exhibit the issue (if applicable):
  • React version: n/a
  • Browser: n/a
  • Stack trace (in case of a JS error): No stack trace
bug

All 4 comments

I cannot reproduce it on your CodeSandbox, with the latest stable version of react admin.

image

Am I missing something?

Sorry, I forgot to give a step to reproduce in CodeSandbox 馃槃 You have the problem in your screenshot, you can see an unwanted message below the first dropdown that should not appear.

66294299-f0b59700-e8e8-11e9-8489-8a5205eebeab

Damn! Sorry, I didn't see that, you're right.
Thanks for reporting it!

Actually that's not an issue. ReferenceInput only deals with references using their identifiers. If you use anything other than the resource identifier field then it cannot retrieve it hence the message.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pixelscripter picture pixelscripter  路  3Comments

ilaif picture ilaif  路  3Comments

Dragomir-Ivanov picture Dragomir-Ivanov  路  3Comments

Kmaschta picture Kmaschta  路  3Comments

mbj36 picture mbj36  路  3Comments