The problem is that autocomplete keeps track of the value that it matches inside, so when you first enter j , it sets this internal value to 'j', and then it was not reset for the empty string when you changed the input to empty.
Having looked at the autocomplete source, I couldnโt find out how to directly access the internal variable, but you can force autocomplete to update it for you by running another search after you change the input to empty (and with a length of zero it actually does not search )
$(function() { $("#search").autocomplete({ source: data, change: function() { // Triggered when the field is blurred, if the value has changed; ui.item refers to the selected item. $("#search").val(""); $("#search").autocomplete("search", ""); //THIS IS THE NEW LINE THAT MAKES IT HAPPY } }); });
Cebjyre
source share