jQuery UI Autocomplete On change Event Not Firing Real Time

Using jQuery UI, I am trying to fire an event as soon as the value of the #tag input changed but as you can see the log event fires if user clicks on the page and not as soon as the value of the input changes

I already tried to bind the change event with paste but I am getting the same result.

 $( function() {
    var availableTags = [
    $( "#tags" ).autocomplete({
      source: availableTags
     $("#tags").on('change', function(){
  } );

can you please let me know how to fix this?

Source: stackoverflow-javascript