javascript/select2: keyboard shows when select is clicked

select2 templateresult
select2 cdn
select2 multiple select all
select2 mobile
select2 widget
jquery select plugin
jquery select dropdown
chosen2

I'm using select2 and I'm using it more or less like this:

<select id="e1">

    <option value="AL">Alabama</option>

    <option value="WY">Wyoming</option>

    ....

</select>

and the code

$('#e1').select2({ minimumResultsForSearch: -1 }) ;

With that option set to -1 it doesn't show the search box, but on the iPad/iPhone it does show the keyboard. Is there any way I can prevent the keyboard from showing ?


Using jQuery, add this to a container of your select2

$(".someSelect2Container input").prop("readonly",true);

Select2 not working with keyboard · Issue #4514 · select2/select2 , Based on https://select2.github.io/examples.html If you tried clicking on h key then Hawaii selected successfully, but if you clicking on select2 E.g.: on a normal select of Australian states, I can tab into it, hit V (which shows  When you see your preferred language in the list to the right, click it to select it. Then click Add in the lower-right corner of the window to add your preferred language. You can add as many languages as you need. Click the flag or character icon in the menu bar at the top fo the screen to select your preferred keyboard layout or language.


I solved this problem for iOS:

 $(document).ready(function() { $("select").select2(
            .on("select2-selecting", function(e) {
                setTimeout(function() {
                    document.activeElement.blur();
                }, 500);
            }); 
         });

Virtual keyboard showing up always · Issue #1541 · select2/select2 , If select2 is used the virtual keyboard is showing up always if a user Also virtual keyboard is overlaying select options. and add this js:. Keyboard typing multiple letters or double letters; PC or laptop keyboard typing extra letters; Keyboard typing random letters; Sometimes you can’t type @ symbol too. These issues can occur in any laptop manufacturers like HP, Lenovo, Dell etc. and can also occur in Windows 8, Windows 7 and Windows XP.


For people searching in the future if you're looking to keep the search functionality but STOP the keyboard from automatically popping up and taking up the screen space on mobile... the following worked for me (may be a faster/easier way to do it but I did it quickly to test and it worked and I was so excited I had to post it here):

    window.select2typing = false;
    $(document).on("focus",".select2-search__field",function(){
        if(window.select2typing == false){
            $(this).blur();
        }
    });

    $(document).on("click",".select2-search__field",function(){
        window.select2typing = true;
        $(this).focus();
    });

    $("select").on("select2:close",function(){
        window.select2typing = false;
    });

This will stop the keyboard from popping up, stop it from auto-focusing the select2 search field and once they tap/click on the search field it'll give them the option to start typing.

Scrolls to bottom when option selected - Is this a bug?, I made a form with 2 selectors using the Select2 to display a big list of for both CSS and JS 4.0.7 version from their CDN as they show on their page. the keyboard to select an item, rather than clicking it with your mouse? Get Value or Selected Option in Select Box There are a variety of ways to use JavaScript to obtain the value of the selected option in a select list or a reference to the selected option: Use the value property of the select list.


Dropdown, By default, Select2 will display the text property of each data object within the list of option to prevent the dropdown from closing when a result is selected: javascript/select2: keyboard shows when select is clicked it does show the keyboard. Is there any way I can prevent the keyboard from showing ? search field


Add, select, or clear items, The fourth parameter sets the options actual selected state - if set to true , the the option with a value of '1' $('#mySelect2').trigger('change'); // Notify any JS  The following program shows how to dropdown list onchange event in Javascript. While you change the selection from javascriptcombobox you can see the color of Div element is changing. Red Blue Green Yellow Orange White


jQuery Select Box Components, Taulant Spahiu compares Chosen and Select2 head-to-head. "//cdnjs.​cloudflare.com/ajax/libs/chosen/1.4.2/chosen.jquery.min.js"></script> When the dropdown is open, you can click any selected element to deselect them. I have set Chosen up to add an alert showing that the limit has been reached:. I would like to have events associated with the formatNoMatches text, along the lines of: formatNoMatches = function (term) { return "No matches. Add a new item</button>"; } What is the best way to add a click handler to the give