title: How to make jQuery autocomplete list display all options onfocus and hide after option is selected?
body: <p>I have a form with an autocomplete that starts the search "onfocus" and shows the option list when the user clicks into the search field, even when they do not enter anything.</p>
  
  <p>The problem is the autocomplete requires the option to be selected with either the keyboard (down arrow followed by tab/return or with a double click).  My first thought was that a single click causes the focus to remain in the search field, and thus the autocomplete to stay visible.  However, the search field remains focused after the second click, but the autocomplete disappears after the second click.</p>
  
  <p>Any ideas?</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function() {
  
      var autocomplete_focus = function(){           
          if ($(this).val().length == 0) {
              $(this).autocomplete("search", "%");
          }
      }   
  
      $( ".autocomplete" ).autocomplete({
              source: "../../db/autocomplete_list.php",
              minLength: 0
      });
  
      $( ".autocomplete" ).focus(autocomplete_focus);
  
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>I realize a <a href="https://stackoverflow.com/questions/4479598/jquery-autocomplete-ui-id-like-it-to-start-the-search-onfocus-without-the-user">similar question</a> has been posted on here before; however, the proposed solutions are not working for me.</p>