Skip to content

Commit 737b690

Browse files
committed
Selectmenu: Use $.ui.escapeSelector
1 parent 803eaf2 commit 737b690

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ui/selectmenu.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ return $.widget( "ui.selectmenu", {
9090
);
9191

9292
// Associate existing label with the new button
93-
this.labels = this.element.labels();
93+
this.labels = this.element.labels().attr( "for", this.ids.button );
9494
this._on( this.labels, {
9595
click: function( event ) {
9696
this.button.focus();
@@ -423,7 +423,8 @@ return $.widget( "ui.selectmenu", {
423423
return;
424424
}
425425

426-
if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" + this.ids.button ).length ) {
426+
if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" +
427+
$.ui.escapeSelector( this.ids.button ) ).length ) {
427428
this.close( event );
428429
}
429430
}

0 commit comments

Comments
 (0)