-
Notifications
You must be signed in to change notification settings - Fork 627
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
Select search field does not auto-focus on Safari #577
Comments
I've just noticed this too which is pretty annoying for the UX. Did you have a look at a PR? If not I might this week, time allowing. |
I haven't looked at a PR yet, no. Was holding off until the project maintainers gave some direction on why the existing behavior is like it is. |
Thanks for contributing to this issue. As it has been 60 days since the last activity, this issue is being automatically closed. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! |
This issue still exists, including on the demo page. |
Having issues with this also and would love a fix. It's unintuitive (and not obvious to user) tapping twice to search the choices. (I just switched from an ancient MooTools clone of Chosen and find it strange it handled this better.) |
Safari doesn't seem to allow you to programmatically change the focus. Other tools likely use the same input field for the initial input + search, whereas Choices seems to use a separate input field for the search field. |
bump |
It actually can. edit: updated the fiddle due to it not triggering in an older safari. |
I ran into the same problem and managed to come up with a workaround that might interest some of you facing the same issue. Now, when the user clicks on an input field, the keyboard comes up and the input field from choices is focused. No need for a second click interaction. So, the problem was with getting my input for choices to behave correctly. Strangely enough, using the input itself as an event listener didn't quite work for me (still scratching my head about why). So, I found a workaround using an invisible button placed on top of the input. Here's what I did:
Assuming you've got your choices setup running smoothly, let's dive into the JavaScript part:
I got the focusAndOpenKeyboard function from this StackOverflow answer While it would be preferable to have Choices integrate or fix this directly, given that this problem has persisted for more than 4 years, I believe we're left with no choice but to continue using this workaround. Hope this helps! |
If you are looking for a workaround for flutter in app web view focus issue the solution presented by @mattisvensson works great for iOS |
On Firefox and Chrome when you open a Select control, the search field is auto-focused. On mobile, this causes the on-screen keyboard to activate and makes it obvious the list is searchable.
On iPad and iPhone, the input is not focused. By default, there is no search text placeholder, either. The result is that users on these devices often do not realise there is any way to filter the list and instead scroll it.
My preferred solution would be to auto-focus the search input on all platforms.
From a cursory read of the code it's not clear to me whether the intention is to grab focus or not. I'm happy to take a run at a PR on this but I'd like to understand the intention of the existing code before I do.
Thanks!
The text was updated successfully, but these errors were encountered: