JqueryUI自动完成在焦点上返回错误的项目

Fra*_*rfo 2 javascript jquery jquery-ui


我在这个项目中使用了JqueryUI.
当我使用向下箭头键关注列表中的下一个项目时,jqueryui返回上一个选定的项目

这里是一个完美的工作样本在这里jsFiddle

这是Jquery代码

$( "#itemname" ).autocomplete({
    source: function( request, response ) {
            var matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( request.term ), "i" );
            response( $.grep( tags, function( item ){
                return matcher.test( item );
            }) );
        }, 
        //focus: function(event) { alert( event.type ); }
        focus : function(event, ui) { 
            //alert( $(this).val() );
            var item_name_this = $(this).val();
            $('#properties_item_name').html(item_name_this);               
        }
});
Run Code Online (Sandbox Code Playgroud)

Moh*_*dil 5

focus: function (event, ui) {
     var item_name_this = ui.item.value;
     $('#properties_item_name').html(item_name_this);
}
Run Code Online (Sandbox Code Playgroud)

演示--> http://jsfiddle.net/VCd4J/16/