JSFiddle - React, Tailwind, and code Playground
HTML
<input id="search" type="input" />
JavaScript
$(function() {
var availableTags = [
"item1","item2","item3"
];
$("#search").autocomplete({
source:availableTags,
minLength: 0
});
$("#search").keypress(function(e){
if (!e) e = window.event;
if (e.keyCode == '13'){
$('#search').autocomplete('close');
return false;
}
});
});