AutocompleteInput does not respect createLabel prop
See original GitHub issueThe createLabel text and selection is missing in version 4.1.3. It is showing correctly on SelectInput but not AutocompleteInput even though it is documented on the AutocompleteInput docs.
https://marmelab.com/react-admin/AutocompleteInput.html
The label for the menu item allowing users to create a new choice. Used when the filter is empty
The end of this list should show “Create New Type” when no input is put in
<ReferenceInput source="typeId" reference="customer-types">
<AutocompleteInput
source="name"
createLabel="Create New Type"
createItemLabel="Create %{item}"
create={<SimpleCreate resource="customer-types"/>}/>
</ReferenceInput>
Issue Analytics
- State:
- Created a year ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
[TypeScript] Fix disableClearable prop on ...
Setting the prop disableClearable does work on a regular AutocompleteInput component. This can be checked by adding the disableClearable prop to ...
Read more >The AutocompleteInput Component - React-admin
If a prompt is not enough, you can use the create prop to render a custom component instead. optionText. You can customize the...
Read more >AutocompleteInput suggestions are not working
Any thoughts? Here's the broken AutocompleteInput: export const ProductFilter = props => ( <Filter {...props}> <ReferenceInput label=" ...
Read more >Demystifying Errors in MUI Autocomplete — part
Therefore 'options' prop is mandatory. With respect to the input field, Autocomplete is an abstract input field. We need to specify what input ......
Read more >react-admin - Projects - FOSSA
You've either hit a dead end searching or the project you're inspecting has no dependencies. If you feel the results are incorrect, take...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@davidhenley It’s no really that it would be hard to implement, but rather that this component already handles many props for many cases, and we fear that adding one more would make it too confusing.
Actually we thought of adding a prop like
shouldAllowCreate
or something in this taste to handle this, but we gave it up for the reason I mentioned.Still, if you disagree with us, please let us know here, we might change our minds about this 😅
Thanks @slax57
I searched the linked code before creating the issue and the creation stuff looks identical to SelectInput. Couldn’t figure it out.
I would debate at least for our purposes that AutocompleteInput should have createLabel, because sometimes we know that we need to add one on the fly before even searching and it makes sense to just click the create button before beginning to type. Especially if there are multiple fields in the new dialog. This is how we’ve been using it already.