Skip to content
Permalink
Browse files

Selectmenu: fix closing of empty selects

  • Loading branch information...
fnagel committed Dec 13, 2012
1 parent c69d01b commit 1ea22565d33760dfcc6c296b0586e459412c2218
Showing with 8 additions and 3 deletions.
  1. +8 −3 ui/jquery.ui.selectmenu.js
@@ -222,11 +222,16 @@ $.widget( "ui.selectmenu", {
return;
}

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 );

// check if we have an item to select
if ( this.menuItems ) {
var id = this._getSelectedItem().find( "a" ).attr( "id" );
this.button.attr( "aria-activedescendant", id );
this.menu.attr( "aria-activedescendant", id );
}

this._trigger( "close", event );
},

0 comments on commit 1ea2256

Please sign in to comment.
You can’t perform that action at this time.