我在我正在从事的这个项目中使用了 JqueryUI。
当我使用向下箭头键关注列表中的下一个项目时,jqueryui 返回上一个选定的项目
Here's a perfect working sample is here on 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);
}
});
最佳答案
focus: function (event, ui) {
var item_name_this = ui.item.value;
$('#properties_item_name').html(item_name_this);
}
关于javascript - JqueryUI 自动完成在焦点上返回错误的项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16611286/