JSFiddle - React, Tailwind, and code Playground
HTML
<input id="in1" />
JavaScript
$(function() {
var firstval = ["five","six","seven","eight"];
var obj = $('#in1').autocomplete({
source: firstval,
minLength: 0
}).focus(function(){
var secondval = ["Banana", "Orange", "Apple", "Mango"];
obj.autocomplete({
source: secondval.concat(firstval),
minLength: 0
})
$(this).data("autocomplete").search($(this).val());
});
});