TheRealPapa
TheRealPapa

Reputation: 4539

Select2 difficult to use on Android phone, due to predictive text

I am using the latest version of select2 with ajax on a mobile webapp. It is a great plug in but very difficult to use on a Galaxy Edge phone.

It is difficult to select the second or third entry listed in the search results of the drop down.

I have noticed though that turning predictive text on the phone off, it works very well.

I have tried adding this on my select input:

autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"

and although I can see it flow through to the select2 input box after render, it does not disable predictive text / autocomplete as desired.

Has anybody solved this issue as I cannot find a direct reference to this problem.

Upvotes: 4

Views: 1921

Answers (1)

Bud Damyanov
Bud Damyanov

Reputation: 31919

If you have difficulties selecting items from the select2 (as described here because of the popping of virtual keyboard), try this after you initialize the select2:

  jQuery('.select2-search input').prop('readonly', true);

Or, try this workaround:

jQuery(document).on('touchend', function(){
jQuery(".select2-search, .select2-focusser").remove();
})

This will prevent keyboard from showing on multiple select

Upvotes: 1

Related Questions