-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AutocompleteInput does not respect createLabel prop #7822
Comments
Hi,
I'll request the team's pov. |
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. |
Okay, so here's the bottom line.
|
@slax57 Could I ask why this is so much harder to implement than the SelectInput? What are the pain points? I'm trying to look at both to get a better feel for the CreateSuggestionContext and how I can implement it. https://github.com/marmelab/react-admin/blob/master/packages/ra-ui-materialui/src/input/SelectInput.tsx |
@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 Still, if you disagree with us, please let us know here, we might change our minds about this 😅 |
So my 2 cents is create/createLabel is much more important to have on AutocompleteInput than SelectInput. If you are using SelectInput to create new items often enough to have an on-the-fly create prop, that list will definitely grow too large for the SelectInput and you need to eventually change it out to an AutocompleteInput. |
Closing this after merging #7844 was intended, since, after internal discussion with the team, we agreed that it would be best not to add complexity to the component, and only improve the docs for this use case. However, I agree that you make a good point here. Best I can do is request the opinion of @fzaninotto and @djhi , which are more experience than me with RA, and hence I consider to have a more valuable opinion than mine 😁 If you wish, you may also work on a PR to add this, which may convince us that the complexity is manageable, but I can't promise we will accept it 😅 |
@slax57 we still really need this functionality. I just don't understand why it used to work, but then was taken away. This is such a trivial feature that made it very clear that you can create new items. All it needs to do is open the dialog, just like the create prop does but pass an empty filter? It looks like others have mentioned it as well. I would love for this to be fixed. |
@davidhenley I agree. Let's track this via #9616 |
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 end of this list should show "Create New Type" when no input is put in
The text was updated successfully, but these errors were encountered: