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

Special selection jquery Selectable

I have a calendar grid (for month). And I want to select period for event. Like at the picture:
Picture 1.
enter image description here

Picture 2.
enter image description here

How can I implement such a selection (when user drag down with the mouse over the cells (8, 15, 22 on picture) he selects all weeks that intersect the cells (picture 2)).
It seems, JQuery UI selectable plugin doesn’t help to make such selection (it would select only 3 cells (8, 15, 22)). Maybe it can or there are other libraries that helps to do that. Maybe It can be fixed with plain js…
Please, advise something.

Source: stackoverflow-javascript