2012-08-10 5 views

Répondre

1

Vous devez supprimer la mise au point manuellement à partir du champ de saisie avec Javascript comme ceci:

$('.ui-listview-filter .ui-input-text').live('keyup', function(event) { 
    if (event.keyCode == 13) { 
     // 'Go' pressed 
     $('.ui-listview-filter .ui-input-text').trigger('blur'); 
    } 
}); 
+0

C'est exactement ce dont j'avais besoin! Merci. – rdkit

0

Vous pouvez essayer de changer la mise au point après avoir appuyé sur la touche. Par exemple:

//this will un-select the text box, hiding keyboard 
$('#searchInputId').blur(); 

//this will focus on something else, hiding keyboard 
$('#somethingOtherThanTheSearch').focus(); 
0

variante de la réponse de Pablo qui fonctionne sur mon ancienne version de jQuery (mobile):

// this is here to close the on-screen keyboards of mobile devices when the "go" button is used 
    $("input[data-type='search']").on('keyup', function(event) { 
    if (event.keyCode == 13) { // Enter or 'Go' pressed 
     event.target.blur(); // remove focus on the search field so keyboard goes away 
    } 
}); 
Questions connexes