]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: Trigger close after hiding the menu. Fixes #6227 - Autocomplete: Don...
authorScott González <scott.gonzalez@gmail.com>
Tue, 26 Oct 2010 13:05:38 +0000 (09:05 -0400)
committerScott González <scott.gonzalez@gmail.com>
Tue, 26 Oct 2010 13:05:38 +0000 (09:05 -0400)
tests/unit/autocomplete/autocomplete_events.js
ui/jquery.ui.autocomplete.js

index a8924e192a4d831aaa258993aba100c2f51b9a37..95a86425c361d253bdbc2f66d9d7b4febe770fb0 100644 (file)
@@ -28,7 +28,7 @@ test("all events", function() {
                },
                close: function(event) {
                        same(event.type, "autocompleteclose");
-                       same( $(".ui-menu:visible").length, 1 );
+                       same( $(".ui-menu:visible").length, 0 );
                },
                select: function(event, ui) {
                        same(event.type, "autocompleteselect");
index 0ada32f0243f9ccb301ff0bb2deba96699bcf8df..1e07b3c16184f5a2da529f9b1be4960b853c0291 100644 (file)
@@ -295,9 +295,9 @@ $.widget( "ui.autocomplete", {
        close: function( event ) {
                clearTimeout( this.closing );
                if ( this.menu.element.is(":visible") ) {
-                       this._trigger( "close", event );
                        this.menu.element.hide();
                        this.menu.deactivate();
+                       this._trigger( "close", event );
                }
        },