-
-
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
SelectInput ignores emptyValue property #8060
Comments
Thanks for your report. Would you mind adding a reproduction based on the simple example codesandbox? https://codesandbox.io/s/github/marmelab/react-admin/tree/master/examples/simple |
https://codesandbox.io/s/lucid-haibt-b0p0zm?file=/src/posts/PostEdit.tsx See the example with editing a post. A user select input is at the bottom of the first tab of the edit form. In the console, the object is seen to have |
I encount this problem too. I tried some cases.
|
A code sandbox was added to this ticket 2 months ago can the tag "needs more info" be removed, please? |
The empty value of a SelectInput inside ReferenceInput is set to There is a remaining bug, which is that if a record has no value for a reference and the user doesn't update it, So I'm marking this a s a bug. |
Besides, |
What you were expecting:
The emptyValue is sent when the empty option is selected in a SelectInput.
What happened instead:
An empty string is sent.
Steps to reproduce:
Add emptyValue={null} property to a SelectInput.
Related code:
When the form loads, {assignedToId: null, ...} is received, but when the user clicks save then the form sends {assignedToId: '', ...}
Environment
The text was updated successfully, but these errors were encountered: