Skip to main content
adicionou 4 caracteres ao conteúdo
Fonte Link
user94609
user94609

Quem estiver com o mesmo problema basta colar esse script

$(document).on('touchstart', function (e) { let target = $(e.target); if (!target.is("span")) { //checking if you are tapping on items in multiple select or not $(document).trigger('click'); //if you are tapping outside multiple select close it $(':focus').blur(); //focus out for multiple select so you can choose another or the same (in case you have more multiple selects on page) } else { //nothing or fire another event }; });

$(document).on('touchstart', function (e) {
    let target = $(e.target);
    if (!target.is("span")) { //checking if you are tapping on items in multiple select or not
        $(document).trigger('click'); //if you are tapping outside multiple select close it
        $(':focus').blur(); //focus out for multiple select so you can choose another or the same (in case you have more multiple selects on page)
    } else {
        //nothing or fire another event
    };
});

Quem estiver com o mesmo problema basta colar esse script

$(document).on('touchstart', function (e) { let target = $(e.target); if (!target.is("span")) { //checking if you are tapping on items in multiple select or not $(document).trigger('click'); //if you are tapping outside multiple select close it $(':focus').blur(); //focus out for multiple select so you can choose another or the same (in case you have more multiple selects on page) } else { //nothing or fire another event }; });

Quem estiver com o mesmo problema basta colar esse script

$(document).on('touchstart', function (e) {
    let target = $(e.target);
    if (!target.is("span")) { //checking if you are tapping on items in multiple select or not
        $(document).trigger('click'); //if you are tapping outside multiple select close it
        $(':focus').blur(); //focus out for multiple select so you can choose another or the same (in case you have more multiple selects on page)
    } else {
        //nothing or fire another event
    };
});
Fonte Link
user94609
user94609

Quem estiver com o mesmo problema basta colar esse script

$(document).on('touchstart', function (e) { let target = $(e.target); if (!target.is("span")) { //checking if you are tapping on items in multiple select or not $(document).trigger('click'); //if you are tapping outside multiple select close it $(':focus').blur(); //focus out for multiple select so you can choose another or the same (in case you have more multiple selects on page) } else { //nothing or fire another event }; });