I'm struggling with an issue on JqueryUI and its autocomplete widget. Whenever it finds at least one match, the widget appears fine. The issue occurs if the user doesn't select one of the proposals and keeps typing. Here is an example:
Auto complete finds matches, everything is fine.
User keeps typing, the searchs results are narrowed, everything is still OK
User keeps typing even more, there is no match left, but the widget remains open.
This is the behaviour I want to get rid of. I'm running JqueryUi version 1.9.2. I read this question and tried using the widget's "response" event, as suggested.
response: function(event, ui) {
if (ui.content.length === 0) {
$("#field").autocomplete('close');
}
}
Unfortunately, this accomplishes nothing in my case, because there is no response event triggered when the last match is lost.
Is there a way to fix this ?
EDIT : It seems that later versions of jQuery UI fix this. Unfortunately, upgrading to versions 1.10+ implies a LOT of changes, and this library is used like everywhere in my project. That sounds like an extremly huge time investment to fix a minor annoyance. What I'm looking for is a easier workaround.