mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Selectmenu: click an optgroup header should not close the menu
This commit is contained in:
parent
827a8cb35c
commit
bef7f1b15b
8
ui/jquery.ui.selectmenu.js
vendored
8
ui/jquery.ui.selectmenu.js
vendored
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user