-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[useAutocomplete] Add option to disable selecting text on first focus #19134
Comments
What's the motivation for this behavior? |
So that you can use useAutoComplete without the input text being selected in the initial focus. Here is a work around for anyone else that wants to opt out of the select behavior:
|
I had a closer look at the issue. I think that you are raising an interesting concern. Say that you want to implement a search bar with suggestions (I have this very use case). Then, you will benchmark that not selecting thei input text on first focus is a common approach. For instance, Google search won't select while Chrome URL box will. |
@Bebersohl What do you think of a new selectOnFocus = !freeSolo; |
@oliviertassinari Sounds good to me. |
Great, do you want to submit a pull request? :) |
Sure |
Summary 💡
The text of the input is selected on first focus of input. Add a new prop to useAutocomplete to opt out of this behavior
Examples 🌈
add
selectTextOnFirstFocus
prop that defaults to trueMotivation 🔦
To make useAutocomplete more flexible.
The text was updated successfully, but these errors were encountered: