Autocomplete not firing on first character

Autocomplete not firing on first character

Hi!

I have implemented the jQuery UI autocomplete script, but the autocomplete is not firing on first character.
I have an input field with a static value on page load. When I change this value, the autocomplete is not firing. When I delete the character I typed and type it again, the autocomplete is working.

Am I doing something wrong? I can't find any information about this problem.

  1. var quantities = ['10','20','25','30','35'];
  2. $('#quantity').autocomplete({
  3.         minChars:1,
  4.         noCache: true,
  5.         source: function( request, response ) {
  6.             var matches = $.map( quantities, function(quantity) {
  7.               if ( quantity.toUpperCase().indexOf(request.term.toUpperCase()) === 0 ) {
  8.                 return quantity;
  9.               }
  10.             });
  11.             response(matches);
  12.         }
  13.     });
I hope somebody can help me :)