title: Text input stealing focus when a jQuery tab is clicked
body: <p>I am building a web interface built around jQuery tabs, where the first tab contains a text input that can be used as a quick search through the other tabs. <strong><em>I want the textbox to gain focus as soon as the first tab is selected</em></strong>, so the user can start typing asap.</p>
  
  <p>Currently I'm trying to use the <code>tabsselect</code> event to bind the focus-stealing function, however it seems that I'm missing something.</p>
  
  <p>my current code: </p>
  
  <pre><code>$("#usertabs").tabs().bind("tabsselect",function( event, ui){
      if(ui.index == 0){
          alert('fire');
          $('#barcodeselect').focus();
      }
  });
  </code></pre>
  
  <p>When I click the first tab, the alert pops up, and as soon as I dismiss it, the first tab is shown, however the <code>textbox</code> does not have focus. </p>
  
  <p>Calling <code>$('#barcodeselect').focus();</code> from a <code>console</code> does have the desired effect, so it shouldn't be a typo or something like that..</p>
  
  <p>Could it be that the changing of tab steals focus from the <code>textbox</code>? If so, is there a way to bind on the tab change being <strong><em>finished</em></strong> instead of <strong><em>beginning</em></strong>? Or am I just being oblivious?</p>