Ipad jQueryMobile-在listview中过滤并按键盘上的Go键不';隐藏键盘

Ipad jQueryMobile-在listview中过滤并按键盘上的Go键不';隐藏键盘,ipad,jquery-mobile,Ipad,Jquery Mobile,在jquerymobile中,有经过筛选的列表视图。在过滤器中输入文本后,列表将被过滤,但按下GO按钮不会隐藏键盘 用户希望键盘在按下GO键后隐藏。 有什么方法可以做到这一点吗?您可能想在按键后尝试改变焦距。例如: //this will un-select the text box, hiding keyboard $('#searchInputId').blur(); //this will focus on something else, hiding keyboard $('#some

在jquerymobile中,有经过筛选的列表视图。在过滤器中输入文本后,列表将被过滤,但按下GO按钮不会隐藏键盘

用户希望键盘在按下GO键后隐藏。
有什么方法可以做到这一点吗?

您可能想在按键后尝试改变焦距。例如:

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

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

您可能希望在按键后尝试更改焦距。例如:

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

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

您必须使用Javascript手动从输入字段中删除焦点,如下所示:

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

您必须使用Javascript手动从输入字段中删除焦点,如下所示:

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

Pablo回答的变体,适用于我过时版本的jQuery(mobile):


Pablo回答的变体,适用于我过时版本的jQuery(mobile):


这正是我需要的!谢谢。这正是我需要的!谢谢