-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
several fix and enhancements #1906
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
Conversation
@@ -158,6 +158,12 @@ $.extend(Selectize.prototype, { | |||
$control_input.attr('placeholder', settings.placeholder); | |||
} | |||
|
|||
// to have an identical rendering to a simple select (usefull for mobile device and do not open keyboard) | |||
if (!self.settings.search) { | |||
$control_input.attr('readonly', true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a problem with ReadOnly.
If the person clicks on the input and types something on the physical keyboard the input will remain empty, but selectize will filter the items and will work anyway.
To fix this just listen to the focus event and when the input receives focus you apply a blur. That way the input will never be focused and the person will never be able to type anything and we won't have any problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A suggestion also to prevent the keyboard on mobile devices is to use $control_input.attr("inputmode", "none");
Some mobile browsers ignore the read_only property and show the keyboard anyway. But they respect input_mode.
The ideal is to have the 2 codes, read_only and input_mode none.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you so much for your feedback, I fixed that !
!important
for apply style when position is top with pluginauto_position