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 = [
      "ActionScript",
      "AppleScript",
      "Asp",
      "BASIC",
      "C",
      "C++",
      "Clojure",
      "COBOL",
      "ColdFusion",
      "Erlang",
      "Fortran",
      "Groovy",
      "Haskell",
      "Java",
      "JavaScript",
      "Lisp",
      "Perl",
      "PHP",
      "Python",
      "Ruby",
      "Scala",
      "Scheme"
    ];
    $( "#tags" ).autocomplete({
      source: availableTags
    });
    
     $("#tags").on('change', function(){
        console.log($(this).val());
    });
  } );
https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
 https://code.jquery.com/ui/1.12.1/jquery-ui.js
 

can you please let me know how to fix this?


Source: stackoverflow-javascript