We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
What you were expecting: When using a ReferenceField inside a SimpleForm inside an Edit, I expect the same behaviour as in the Show layout.
ReferenceField
SimpleForm
Edit
Show
What happened instead: There is no field name and there are other styling issues.
Steps to reproduce: In a SimpleForm component inside an Edit, use a ReferenceField with a TextField to display a value (with no possibility to edit).
TextField
Related code:
Code here: https://codesandbox.io/s/sad-brahmagupta-rsyv8z?file=/src/comments/CommentEdit.tsx
In the SimpleForm (line 135) of the file src/comments/CommentEdit.tsx, there is this field:
src/comments/CommentEdit.tsx
<ReferenceField source="post_id" reference="posts"> <TextField source="title" /> </ReferenceField>
Other information: It used to work in the v3.
Environment
The text was updated successfully, but these errors were encountered:
This is not a bug. In react-admin v4, if you want to use Fields as children of SimpleForm, you must wrap them with a Labeled.
https://marmelab.com/react-admin/SimpleForm.html#using-fields-as-children
I agree that this should probably be mentioned in the upgrade guide, though.
Sorry, something went wrong.
It works thank you :-) Do you want me to open a pull request to add it in the upgrade guide?
That would be great!
Done :-)
Successfully merging a pull request may close this issue.
What you were expecting:
When using a
ReferenceField
inside aSimpleForm
inside anEdit
, I expect the same behaviour as in theShow
layout.What happened instead:
There is no field name and there are other styling issues.
Steps to reproduce:
In a
SimpleForm
component inside anEdit
, use aReferenceField
with aTextField
to display a value (with no possibility to edit).Related code:
Code here: https://codesandbox.io/s/sad-brahmagupta-rsyv8z?file=/src/comments/CommentEdit.tsx
In the
SimpleForm
(line 135) of the filesrc/comments/CommentEdit.tsx
, there is this field:Other information:
It used to work in the v3.
Environment
The text was updated successfully, but these errors were encountered: