Skip to content
Browse files

Autocomplete: Trigger close after hiding the menu. Fixes #6227 - Auto…

…complete: Don't trigger close event until after the menu is hidden.
  • Loading branch information...
1 parent 9ead629 commit f4d8ec9159b84718051b257715b97d22fba936e7 @scottgonzalez scottgonzalez committed
Showing with 2 additions and 2 deletions.
  1. +1 −1 tests/unit/autocomplete/autocomplete_events.js
  2. +1 −1 ui/jquery.ui.autocomplete.js
View
2 tests/unit/autocomplete/autocomplete_events.js
@@ -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");
View
2 ui/jquery.ui.autocomplete.js
@@ -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 );
}
},

0 comments on commit f4d8ec9

Please sign in to comment.
Something went wrong with that request. Please try again.