Skip to content
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

Documentation update in sample. #9722

Closed
JustinHarshbarger opened this issue Mar 14, 2024 · 3 comments · Fixed by #9825
Closed

Documentation update in sample. #9722

JustinHarshbarger opened this issue Mar 14, 2024 · 3 comments · Fixed by #9825
Assignees

Comments

@JustinHarshbarger
Copy link

What you were expecting:
After updating my version of react-admin (granted I was a bit behind) I started getting errors with editing resources. It appears that at some point there was a change where disabled inputs not longer are sent with the update request record.

What happened instead:
Was sending undefined where it previously sent the disabled id value.

Other information:
I was able to get around this by removing disabled and setting as read only. This is definitely not a high priority ticket, but I figured I'd put in this suggestion.

I think the latest documentation here should be updated to show disabled instead and/or have some sort of note on the disabled prop that it will not be sent with the request.

Environment

  • React-admin version: 4.16.12
  • Last version that did not exhibit the issue (if applicable):
  • React version: 18.2.0
  • Browser: Chrome v122.0.6261.94
@fzaninotto
Copy link
Member

Thanks for your report.

This is a known react-hook-form regression, already discussed in another issue. The solution is to use readOnly instead of disabled (see the doc: https://marmelab.com/react-admin/Inputs.html#disabled).

Closing this issue as duplicate.

@JustinHarshbarger
Copy link
Author

Oh, I did miss the update details below. However, the sample in the usage section is still using disabled on an Edit which will cause problems referencing the record if someone starts with a copy paste from there. Thanks for the quick response.

@fzaninotto
Copy link
Member

You're right! I'm reopening this issue and marking it as a documentation problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants