-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Keyboard pops up after selection is made on mobile devices #818
Comments
Had the same issue with the keyboard on Android with Chrome, popped up twice when the control got focus and after an item has been selected. Here is a quick and dirty fix for the two unwanted keyboard popups (in reverse order). In select.js, the ctrl.close....., comment out: The focusser seems to be a dummy element that receives focus and it looks like it causes the keyboard to pop up, when you select an item and the dropdown closes. Where it does the #templateCache thing right at the end of select.js, last line (assuming you use selectize): $templateCache.put("selectize/select.tpl.html","<div class="ui-select-container selectize-control single" ng-class="{'open': $select.open}"><div class="selectize-input" ng-class="{'focus': $select.open, 'disabled': $select.disabled, 'selectize-focus' : $select.focus}" ng-click="$select.activate()"><div class="ui-select-match"></div><input ng-readonly="!$select.searchEnabled" type="text" autocomplete="off" tabindex="-1" class="ui-select-search ui-select-toggle" ng-click="$select.toggle($event)" placeholder="{{$select.placeholder}}" ng-model="$select.search" ng-hide="($select.selected && !$select.open)" ng-disabled="$select.disabled" aria-label="{{ $select.baseTitle }}"></div><div class="ui-select-choices"></div></div>");}]); So moving searchEnabled to ng-readonly (instead of ng-hide) lets you keep the placeholder text, does not cause the first keyboard popup and does not cause the height shrinkage, which I also experienced. Then also where you use the control in your view in the markup: ...... search-enabled="false". I did not test this thoroughly for side effects. |
i have this problem too, you resolve this in elegant way? |
No, I reverted back to using html . I thought leoncc's proposal was interesting, but was too near release of our software to take the risk. |
Ok thanks. |
+1 for this, would love a fix. |
@leoncc that did the trick for me. Since i'm using Bootstrap I changed select.js to the following:
(the important part was adding
|
+1 |
+1 i have this problem too. How to solve this problem? |
+1 here! |
Tried using jquery blur events on the right elements after a selection with no luck. +1 for a fix. |
+1 |
1 similar comment
+1 |
+1 I came across this: I can verify that commenting the line |
This is also related to the broader discussion on event handlers with the library. |
+1 |
1 similar comment
+1 |
Careful removing this line: Better off using the skip-focusser attribute. |
+1 |
1 similar comment
+1 |
I simply did by writing some css to prevent the keyboard to popup on mobile devices. You can do this for mobiles specifically by detecting touch devices and adding a class to your body for mobile, like |
@osamaurrehman That saved my life today! thanks. |
@leoncc Thanks a lot :) |
I was able to create a directive
then in the template add the read-only attribute
|
part 1. for project requirements on "select.tpl.html" we already have: part 2. to solve the other keyboard placed on this focusser: I did a CSS fix for mobile resolutions and it works fine:
|
+2 |
I've found the following workaround useful: I added |
Banging my head on this for a while, hoping somebody can point me in the right direction. On iOS the keyboard is displayed momentarily, however on android it persists when viewed with Firefox or Chrome and is not removed until it looses focus. Here's the code, not much to it:
The scenario is:
Am I missing something?
Any ideas on how I could prevent this from occurring?
Is this a bug or feature?
<grin>
Thanks for looking,
John
The text was updated successfully, but these errors were encountered: