-
-
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
3.0.0-beta.6: AutocompleteInput do not support allowEmpty #3981
Comments
#1 Please add allowEmpty to ReferenceInput like this:
That's how you add an empty item to the list of suggestions. #2 Clearing the input field still does not clear the selection though. |
As @MiMo42 said, this is not a bug - rather a wrong usage. The As for #2, it's a more general problem: just typing text in the box isn't enough to select an option (the empty option lust like any other), users MUST click on an option in the list. I agree that's not ideal in terms of usability. Feel free to open a PR if you have a better alternative. |
Yes, that's the way in unfortunately works in react admin :-/. No incarnation uses an additional empty item in list of suggestions. Some components additionally allow pressing ESC to clear the selection (to avoid massive backspacing etc.), some provide us with an additional icon to clear the input. |
We had this before and it has been a source of frustration for many users.
This would be pretty nice indeed. Would you open a PR to implement it ?
This too. |
To change the current behaviour would introduce a BC break as properties would change fundamentally. Material-ui lab(!) component supports additional properties like disableCloseOnSelect, clearOnEscape, disableClearable, disableOpenOnFocus, disableListWrap etc. Btw.: All our efforts on existing react-admin autocomplete will get obsolete as soon as material-ui's lab autocomplete will move to the core. Suggestions? |
Testing the mui autocomplete in isolation (inside an addon package) until it is ready ? |
|
so AutocompleteInput will not support to be empty.it will always have a value .if user have select one option ,will never clear it to be empty? |
@fzaninotto i mean use < AutocompleteInput > alone ,it also can not be empty after user have select one option . |
What you were expecting:
allow empty of the AutocompleteInput
What happened instead:
AutocompleteInput after select one value ,even you clear the input , always save the last selected choice .
same as #3933
Related code:
Environment
The text was updated successfully, but these errors were encountered: