JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/ui/1.11.3/jquery-ui.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css">
<input type="text" id="sqms-auto-search"/>
JavaScript
var CHOICES = [{ label: 'one À'},
{ label: 'two' }];
$("#sqms-auto-search").autocomplete({
source: function(request, response) {
$.ajax({
type: 'post',
url: '/echo/json/',
data: {
json: JSON.stringify(CHOICES),
delay: 0.3
},
dataType: 'json',
success: function(items) {
response($.map(items, function(item) {
return $('<span></span>').html(item.label).text();
}));
}
});
},
delay: 500,
minLength: 1
});