Skip to content

Commit f61e065

Browse files
committed
Selectmenu: saner handling of click on label
1 parent c0e7122 commit f61e065

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

ui/jquery.ui.selectmenu.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@ $.widget( "ui.selectmenu", {
6262
var that = this;
6363

6464
// Associate existing label with the new button
65-
// this.label = $( "label[for='" + this.ids.element + "']" );
66-
// this._on( this.label, {
67-
// click: function( event ) {
68-
// this.element.focus();
69-
// event.preventDefault();
70-
// }
71-
// });
65+
this.label = $( "label[for='" + this.ids.element + "']" );
66+
this._on( this.label, {
67+
click: function( event ) {
68+
if ( !this.options.nativeMenu ) {
69+
this.open();
70+
event.preventDefault();
71+
}
72+
}
73+
});
7274

7375
// Create button
7476
this.button = $( "<span>", {

0 commit comments

Comments
 (0)