We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 514988e + 2e79f5e commit 6b689fcCopy full SHA for 6b689fc
1 file changed
select2.js
@@ -3387,6 +3387,15 @@ the specific language governing permissions and limitations under the Apache Lic
3387
searchInputPlaceholder: '',
3388
createSearchChoicePosition: 'top',
3389
shouldFocusInput: function (instance) {
3390
+ // Attempt to detect touch devices
3391
+ var supportsTouchEvents = (('ontouchstart' in window) ||
3392
+ (navigator.msMaxTouchPoints > 0));
3393
+
3394
+ // Only devices which support touch events should be special cased
3395
+ if (!supportsTouchEvents) {
3396
+ return true;
3397
+ }
3398
3399
// Never focus the input if search is disabled
3400
if (instance.opts.minimumResultsForSearch < 0) {
3401
return false;
0 commit comments