1.8rc3 autocomplete error in IE6

1.8rc3 autocomplete error in IE6


I've been playing with autocomplete in IE6 and noticed this problem using the combobox demo: if you hover the mouse over the menu, and there is no selected value yet, then click, this error will get triggered:
'Item is null or not an object'

I think this is possible because in IE6 the anchor element inside the li element doesn't take all the width, so on hover it will not get selected.

I've included a photo of the scenario. Notice there is NO element selected on hover.

Testing on the demo page from the development version, triggered the error on line 108 of jquery.ui.autocomplete.js file,
  1. selected: function( event, ui ) {
  2.         var item = ui.item.data( "item.autocomplete" );
  3. ....
I added a line to the refresh function for ui.menu widget and the problem is solved:

  1. refresh: function() {
  2. ....
      ++++  .width("100%")
                .attr("tabindex", -1)
                // mouseenter doesn't work with event delegation
                .mouseenter(function() {