jquery - Remove whitespace and line break from autocomplete's li element -
when focused on auto sugggestion has line break in it's renders whitespaces in input. in suggestion select shows fine.
any solution? tried white-space: nowrap
both on input , on li element , tried running function remove li whitespaces using replace(/<br\s?\/?>/, '')
and how input , suggestion looks like:
this autocomplete code i've written:
$(function() { $( "#searchpagequery" ).autocomplete({ source: getsuggestionssearchpage, autofocus: false, minlength: 2, select: function ( event, ui ) { window.location = ui.item.url; } }); }); function getsuggestionssearchpage ( request, response ) { var params = $("input:checked[name='labels']").serializearray(); var query = { name:"q", value:request.term }; params.push( query ) var params1 = jquery.param( params ); $.ajax({ datatype: "json", url: "@{autocompletesearchr}", data: params1, success: function(data) { var newdata = data.suggestions; response(newdata); } }); }
Comments
Post a Comment