Re-enabled menu requires two clicks to select

Re-enabled menu requires two clicks to select

The code below exhibits the following problem:

If a menu selection disables the menu, performs an Ajax get, and in the 'always' part of the get enables the menu, it takes one extra click on the menu before the menu selects again.

(Load the code, click on '1' or '2', get disable and enable alerts, and click on '1' again. You need to click once more to see the same sequence. Tested in Safari.)

<!DOCTYPE html> 
    <link rel='stylesheet' type='text/css' 

    <script type='text/javascript'
    <script type='text/javascript'
      $(function () {
          select: function (event, ui) {
            alert(ui.item.text()+' menu disabled')
              .done(function () {
              .fail(function() {
              .always(function (){
                alert(ui.item.text()+' menu enabled')
 <title> n/a </title>    
  <body style='overflow: hidden'>
    <ul id='menu'>
      <li> 1 </li>
      <li> 2 </li>