File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -50,4 +50,10 @@ test( "#7092 - button creation that requires a matching label does not find labe
5050 ok ( group . find ( "label" ) . is ( ".ui-button" ) ) ;
5151} ) ;
5252
53+ test ( "#7534 - Button label selector works for ids with \":\"" , function ( ) {
54+ var group = $ ( "<span><input type='checkbox' id='check:7534'><label for='check:7534'>Label</label></span>" ) ;
55+ group . find ( "input" ) . button ( ) ;
56+ ok ( group . find ( "label" ) . is ( ".ui-button" ) , "Found an id with a :" ) ;
57+ } ) ;
58+
5359} ) ( jQuery ) ;
Original file line number Diff line number Diff line change @@ -229,7 +229,7 @@ $.widget( "ui.button", {
229229 // we don't search against the document in case the element
230230 // is disconnected from the DOM
231231 var ancestor = this . element . parents ( ) . last ( ) ,
232- labelSelector = "label[for=" + this . element . attr ( "id" ) + "]" ;
232+ labelSelector = "label[for=' " + this . element . attr ( "id" ) + "' ]" ;
233233 this . buttonElement = ancestor . find ( labelSelector ) ;
234234 if ( ! this . buttonElement . length ) {
235235 ancestor = ancestor . length ? ancestor . siblings ( ) : this . element . siblings ( ) ;
You can’t perform that action at this time.
0 commit comments