]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: fixed #5349 - Autocomplete: mouseover of menu item causes data loss
authorRichard Worth <rdworth@gmail.com>
Mon, 15 Mar 2010 21:11:21 +0000 (21:11 +0000)
committerRichard Worth <rdworth@gmail.com>
Mon, 15 Mar 2010 21:11:21 +0000 (21:11 +0000)
ui/jquery.ui.autocomplete.js

index 7349ce98b7e0fd6f601253a704070fb4228d7095..2efd4e64b893e592d78ab1a74f91b554f0517fbe 100644 (file)
@@ -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;
        },