]> source.dussan.org Git - jquery-ui.git/commitdiff
Selectmenu: Use $.ui.escapeSelector
authorAlexander Schmitz <arschmitz@gmail.com>
Mon, 27 Apr 2015 06:30:01 +0000 (02:30 -0400)
committerAlexander Schmitz <arschmitz@gmail.com>
Wed, 6 May 2015 01:43:57 +0000 (21:43 -0400)
ui/selectmenu.js

index dad7a1b40bf3d1549521f1090b11fe30acf9911b..db2cea712aadea14194befa256f5d7b44410f11f 100644 (file)
@@ -90,7 +90,7 @@ return $.widget( "ui.selectmenu", {
                        );
 
                // 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();
@@ -423,7 +423,8 @@ return $.widget( "ui.selectmenu", {
                                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 );
                        }
                }