-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReferenceInput children not showing "name" optionText when prop is missing #8165
Comments
Thanks for this report. Actually I think it's rather a documentation issue. But now I realize this is actually a BC for AutocompleteInput and SelectInput. Maybe we need to put back 'name' as default optionText for them... Hence I'm marking this as a bug for now. |
There is indeed a slight BC break: if you didn't use I think the documentation is correct for the current version. |
@fzaninotto However I disagree regarding the docs. |
you're right! I didn't notice the default value of |
What you were expecting:
To see a record's "name" value as optionText in an AutocompleteInput or SelectInput when they are a child of a ReferenceInput, and when "optionText" is not given as a prop ("name" is listed as the default optionText in the docs). Adding the
optionText="name"
prop fixes the issue.What happened instead:
The record's ID is shown instead, as in
#${id}
. This bug also has implications for ReferenceInputs with inline Create functionality; the "Create" item is shown as "@@ra-create" instead of "Create".Steps to reproduce:
Create a ReferenceInput / SelectInput combo (or AutocompleteInput) and do not pass the "optionText" prop.
Related code:
I would love to submit a codesandbox for this, but the RA codesandbox appears to be broken; forking it results in numerous errors and an "Initializing" screen that never loads. Not sure if this is an issue with codesanbox or the RA sandbox in particular.
Other information:
Environment
The text was updated successfully, but these errors were encountered: