Skip to content
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

HTML5 inputmode attribute on mobile devices #6224

Open
paonza opened this issue Feb 8, 2023 · 2 comments
Open

HTML5 inputmode attribute on mobile devices #6224

paonza opened this issue Feb 8, 2023 · 2 comments

Comments

@paonza
Copy link

paonza commented Feb 8, 2023

Hi!
I'm using select2 for building responsive websites.
Unfortunately, when using select2 on mobile devices, opening the curtain also opens the keyboard of the device, making everything difficult to manage!
When using select2 on mobile devices, when the select field is opened, the search field should not have automatic focus and should not open any keyboard by default by setting the attribute inputmode='none'.
Subsequently, if the user decides to filter the results by writing in the search field, the attribute should change by opening the keyboard set by the inputmode attribute assigned to the original select (ex: text, decimal, tel, etc)

Do you think it's possible?

@paonza
Copy link
Author

paonza commented Feb 8, 2023

At most it would be sufficient to inherit the inputmode attribute from the original select. In this way it would be possible to "block" the use of the search field and the opening of the keyboard if the attribute was set to "none".
In desktop view the inputmode attribute has no relevance, so it would only affect mobile usage.

@kevin-brown
Copy link
Member

As with many things, I'd be willing to review a pull request which copies the inputmode attribute from the original <select> into the <input /> used for search.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants