From 2be46581da77440b88a9cd55a129c90c6af7a82d Mon Sep 17 00:00:00 2001 From: Richard Worth Date: Mon, 15 Mar 2010 21:11:21 +0000 Subject: [PATCH] Autocomplete: fixed #5349 - Autocomplete: mouseover of menu item causes data loss --- ui/jquery.ui.autocomplete.js | 4 ++++ 1 file changed, 4 insertions(+) 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; },