marmelab / marmelab/react-admin
<AutocompleteInput> freeSolo without clearOnBlur issue
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 26.9k
- Forks
- 5.5k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 19
Description
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
freeSolomode prop seems is replaced bycreateoronCreateprop - After disabling the
clearOnBlurprop, 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):
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the AutocompleteInput component and the CommentEdit.tsx example linked in the issue, then reproduce the freeSolo and clearOnBlur behavior with the provided steps. Done means users can leave typed values without clicking an add option, and the form save button becomes enabled when that value changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100