title: How to prevent closing the menu after a select?
body: <p>I am using the <a href="http://api.jqueryui.com/autocomplete" rel="nofollow noreferrer">jQuery Autocomplete</a> widget and, inspired by <a href="https://stackoverflow.com/questions/6043506/jquery-ui-autocomplete-disable-select-close-events">this question</a> in order to <em>prevent closing the menu after select</em>, I came up with this code:</p>
  
  <pre><code>$(#input_field).autocomplete({
    select   : function(event, ui) {
  
      // I also tried to run 'ui.item.data( "item.autocomplete" );' and it happens
      // the same thing (keep reading for more information).
      ui.item.option.selected = false;
  
    },
    ...
  });
  </code></pre>
  
  <p>It works: the menu is not closed after select. However, I get the following error (in the Firebug console):</p>
  
  <pre><code>TypeError: ui.item.option is undefined
  </code></pre>
  
  <p>Even by using <code>option.selected = false</code> I get <code>TypeError: option is undefined</code> but it works as expected.</p>
  
  <p>How can I solve that?</p>