title: JqueryUI Autocomplete item focus does not work using arrow keys
body: <p>In my jQuery Autocomplete widget, for some reason, the list items are selected properly using mouse and the mouse hover event also works to apply the CSS and change item background appropriately. But when using arrow keys to navigate the Autocomplete list the item is not focused. It does do the default action and populates the input box with the value of the item (I have prevented this default action so as to not populate the input box) But the item is not focused (see screenshot). </p>
  
  <p>CSS:</p>
  
  <pre class="lang-css prettyprint-override"><code>.ui-menu-item:hover{
      cursor: pointer;
      background: #D6DFF2;
  }
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>$.widget("ui.autocomplete", $.ui.autocomplete, {
  options: {
      maxItems: 2
  },
  _renderMenu: function (ul, items) {
      var that = this,
          count = 0;
      $.each(items, function (index, item) {
          if (count &lt; that.options.maxItems) {
              that._renderItemData(ul, item);
          }
          count++;
      });
  }
  });
  
  var initializeAutoComplete = function () {
      $('#example-links').autocomplete({
          source: $('#hidden-action-autoComplete').val(),
          maxItems: 10,
          delay: 750,
          minLength :1,
          select: function (event, ui) {
              event.preventDefault();
              $(this).val(ui.item.label);
              window.location = '/path/to/be/shown/' + ui.item.value;
          },
          focus: function (event, ui) {
              event.preventDefault();
              $('.ui-autocomplete &gt; li').attr('title', ui.item.label + '(' + ui.item.value + ')');
          }
  
      });
  }
  </code></pre>
  
  <p>In the screenshot, I have pressed down arrow key 3 times and currently the third item should have been focused, but it's not.</p>
  
  <p><a href="https://i.stack.imgur.com/PWdrr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PWdrr.png" alt="Autocomplete not focussed"></a></p>