Autocomplete: fixed #5349 - Autocomplete: mouseover of menu item causes data loss

This commit is contained in:
Richard Worth 2010-03-15 21:11:21 +00:00
parent e6c30b0d97
commit 2be46581da

View File

@ -117,6 +117,9 @@ $.widget( "ui.autocomplete", {
if ( self.element[0] !== doc.activeElement ) { if ( self.element[0] !== doc.activeElement ) {
self.element.focus(); self.element.focus();
} }
},
blur: function( event, ui ) {
self.element.val( self.term );
} }
}) })
.zIndex( this.element.zIndex() + 1 ) .zIndex( this.element.zIndex() + 1 )
@ -379,6 +382,7 @@ $.widget("ui.menu", {
this.active.children("a") this.active.children("a")
.removeClass("ui-state-hover") .removeClass("ui-state-hover")
.removeAttr("id"); .removeAttr("id");
this._trigger("blur", null, {});
this.active = null; this.active = null;
}, },