Skip to content
Permalink
Browse files

Selectmenu: click an optgroup header should not close the menu

  • Loading branch information
fnagel committed Jan 26, 2012
1 parent 827a8cb commit bef7f1b15b1576c87faad1eb36458921c2443f30
Showing with 7 additions and 1 deletion.
  1. +7 −1 ui/jquery.ui.selectmenu.js
@@ -253,7 +253,13 @@ $.widget( "ui.selectmenu", {

$.each( items, function( index, item ) {
if ( item.optgroup != currentOptgroup ) {
var optgroup = $( '<li class="ui-selectmenu-optgroup">' + item.optgroup + '</li>' );
var optgroup = $( '<li />', {
'class': 'ui-selectmenu-optgroup',
html: item.optgroup,
click: function( event ){
event.stopPropagation();
}
});
if ( item.element.parent( "optgroup" ).attr( "disabled" ) ) optgroup.addClass( 'ui-state-disabled' );
ul.append( optgroup );
currentOptgroup = item.optgroup;

0 comments on commit bef7f1b

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