);
// Associate existing label with the new button
- this.labels = this.element.labels();
+ this.labels = this.element.labels().attr( "for", this.ids.button );
this._on( this.labels, {
click: function( event ) {
this.button.focus();
return;
}
- if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" + this.ids.button ).length ) {
+ if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" +
+ $.ui.escapeSelector( this.ids.button ) ).length ) {
this.close( event );
}
}