From: Richard Worth Date: Mon, 15 Mar 2010 21:11:21 +0000 (+0000) Subject: Autocomplete: fixed #5349 - Autocomplete: mouseover of menu item causes data loss X-Git-Tag: 1.8~25 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2be46581da77440b88a9cd55a129c90c6af7a82d;p=jquery-ui.git Autocomplete: fixed #5349 - Autocomplete: mouseover of menu item causes data loss --- diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 7349ce98b..2efd4e64b 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -117,6 +117,9 @@ $.widget( "ui.autocomplete", { if ( self.element[0] !== doc.activeElement ) { self.element.focus(); } + }, + blur: function( event, ui ) { + self.element.val( self.term ); } }) .zIndex( this.element.zIndex() + 1 ) @@ -379,6 +382,7 @@ $.widget("ui.menu", { this.active.children("a") .removeClass("ui-state-hover") .removeAttr("id"); + this._trigger("blur", null, {}); this.active = null; },