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 @@ -227,7 +227,7 @@ $.widget( "ui.button", {
227227 // we don't search against the document in case the element
228228 // is disconnected from the DOM
229229 var ancestor = this . element . parents ( ) . filter ( ":last" ) ,
230- labelSelector = "label[for=" + this . element . attr ( "id" ) + "]" ;
230+ labelSelector = "label[for=' " + this . element . attr ( "id" ) + "' ]" ;
231231 this . buttonElement = ancestor . find ( labelSelector ) ;
232232 if ( ! this . buttonElement . length ) {
233233 ancestor = ancestor . length ? ancestor . siblings ( ) : this . element . siblings ( ) ;
You can’t perform that action at this time.
0 commit comments