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 doesn't work correctly

See original GitHub issue

SelectInput component doesn’t display choices (SelectInput always disabled):

<ReferenceInput source="productId" reference="products">
    <SelectInput optionText="name" />
</ReferenceInput>

image

When adding attributes “allowEmpty” and “validation={{ required: true }}” component renders fine:

<ReferenceInput source="productId" reference="products" allowEmpty validation={{ required: true }}>
    <SelectInput optionText="name" />
</ReferenceInput>

image

version 0.9.1

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:13
  • Comments:20 (10 by maintainers)

github_iconTop GitHub Comments

9reactions
fzaninottocommented, Mar 17, 2017

Are you in a <Create> view? If so, it’s expected, as explained in the doc:

Tip: The <Edit> and the <Create> components use the same <ReferenceInput> configuration, except for the allowEmpty attribute, which is required in <Create>.

6reactions
petitchevalrouxcommented, Jul 25, 2017

Ok, by digging more I think my problem is that isRequired != Empty

I just created a component working as I expect in create mode : https://gist.github.com/petitchevalroux/e39bb59d8e8416037f3b96e35a144b22

It allows to choose an item in SelectInput but didn’t allow the form to be submitted with the empty item.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReferenceInput doesn't work as expected · Issue #4562 - GitHub
Version: "react-admin": "3.3.1" When I created the ReferenceInput as below The server ... ReferenceInput doesn't work as expected #4562.
Read more >
React admin ReferenceInput Component does not work as ...
I'm doing it correctly and it should work, but why no suggestions are shown then ? typescript · react-admin · api-platform.com · hydra...
Read more >
Admin-on-rest - Input Components - Marmelab
Tip: If your interface has to support multiple languages, don't use the label ... ReferenceInput passes a setFilter function as prop to its...
Read more >
Dual, Fast, Step-Down Controller's External Reference Input ...
Dual, Fast, Step-Down Controller's External Reference Input Enables Dynamic Voltage Scaling from 0.4V to 5.5V and 0.3% Total Combined Regulation Accuracy.
Read more >
Custom event with reference input warning - Editor Scripting
What does it mean? I tried it out wit a simple printf and it work correctly. Any ideas?
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