question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AutocompleteInput does not respect createLabel prop

See original GitHub issue

The 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

Screen Shot 2022-06-13 at 2 27 31 PM

    <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:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
slax57commented, Jun 16, 2022

@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 😅

1reaction
davidhenleycommented, Jun 15, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found