ReferenceInput allowEmpty impossible to give empty value
Context: When having a ReferenceField with AutoCompleteInput already populated, and being in Edit
Actual behavior: if I want to delete the value given to this field (eg send null value to the API), and delete the text inside the field, the old value will be sent with the request on form submission. Hence it is impossible to "reset" this value.
Expected behavior: Being able to null out a ReferenceField already populated.
Have you added the allowEmpty prop to the ReferenceInput ?
I just reproduced the problem with allowEmpty set
Related to https://github.com/callemall/material-ui/issues/6702
In the meantime, a solution would be to have a custom AutoCompleteInput with a clear button
It looks like issue been resolved on material-ui side, but it still doesn't work in react-admin
Not ReferenceInputController neither AutoCompleteInput components do not use allowEmpty prop at all :(
The problem is not that AutoCompleteInput didn't have "onblur" handler but that the ReferenceInputController doesn't pass down empty choice. For example, the SelectInput component does it itself.
@RusinovAnton seems the issue is still present right?
@djhi can we reopen it? https://github.com/mui-org/material-ui/issues/6702 has been closed but it's still not working, I've tried to add allowEmpty to both ReferenceInput and AutocompleteInput but it still doesn't show the empty value
The problem is still here and seems to be on the react-admin side : using a SelectInput you have a first row that is empty with allowEmpty. There is no empty row with the AutocompleteInput and this is where the bug lies in my opinion.
You can verify this behavior when you do not type anything but just click on the input, it will show a list with no empty option. I understand that it may be inconvenient to have an empty row when typing even though the usual use case appears to be when the field is filled (like in an edit view) and you want to empty it.
It would be really nice from you guys to reopen this issue to work on a solution.
Please open a new issue following the issue template. Besides, I think this is fixed in 3.0.
the same issue here. Version 4.1