Permalink
Browse files

Selectmenu: make isOpen check a guard clause in close method

  • Loading branch information...
1 parent 6fd9d8f commit 0d282630de1fa9b2cd937a0743c727903979e837 @fnagel fnagel committed Nov 29, 2012
Showing with 8 additions and 6 deletions.
  1. +8 −6 ui/jquery.ui.selectmenu.js
View
14 ui/jquery.ui.selectmenu.js
@@ -233,13 +233,15 @@ $.widget( "ui.selectmenu", {
close: function( event ) {
if ( this.isOpen ) {
- var id = this._getSelectedItem().find( "a" ).attr( "id" );
- this.isOpen = false;
- this._toggleAttr();
- this.button.attr( "aria-activedescendant", id );
- this.menu.attr( "aria-activedescendant", id );
- this._trigger( "close", event );
+ return false;
}
+
+ var id = this._getSelectedItem().find( "a" ).attr( "id" );
+ this.isOpen = false;
+ this._toggleAttr();
+ this.button.attr( "aria-activedescendant", id );
+ this.menu.attr( "aria-activedescendant", id );
+ this._trigger( "close", event );
},
widget: function() {

0 comments on commit 0d28263

Please sign in to comment.