react-admin
react-admin copied to clipboard
<AutocompleteInput> freeSolo without clearOnBlur issue
What you were expecting:
In https://mui.com/material-ui/react-autocomplete/ AutocompleteInput have both comboBox mode and freeSolo mode
For freeSolo mode user should be able to type in the input box without the need to click add ...
from the suggestion list.
E.g. https://mui.com/material-ui/react-autocomplete/#search-input
What happened instead:
- The
freeSolo
mode prop seems is replaced bycreate
oronCreate
prop - After disabling the
clearOnBlur
prop, the form save button cannot be clicked even the form's value have changed.
Steps to reproduce:
- Goto https://osy236.sse.codesandbox.io/#/comments/1
- In the last AutocompleteInput box type something other than "comment1" in suggestion list, e.g. "comment2"
- Click away from this input, so the inputbox should now have "comment2"
- The form's save button is not enabled.
Related code:
https://codesandbox.io/s/youthful-diffie-osy236?file=/src/comments/CommentEdit.tsx:4445-4481
Other information:
The suggested behavior would be if freeSolo
is true and onCreate
is undefined,
The user does not need to click the create button in the suggestion list in order to create.
They should be able to type something and leave it there.
Environment
- React-admin version: 4.0.1
- Last version that did not exhibit the issue (if applicable):
- React version: 17.0.2
- Browser: Firefox 99
- Stack trace (in case of a JS error):
Hi, Thank you for submitting this. This does not really seems like a bug to me but rather a feature request. If I'm understanding this correctly the point is to save one click from the user right? I may be missing the point here, so feel free to argue if you disagree 😅
Yes, save-as-you-type. No need further user action to create an entry from popup dialog.