From 0b30a1d450f6b7d529732d6a39c5f4057efaaaf4 Mon Sep 17 00:00:00 2001 From: ddstreet Date: Fri, 11 Mar 2011 10:52:13 -0500 Subject: [PATCH] Button: find associated label even without common ancestor. Fixes #7092 - button creation that requires a matching label does not find label in all cases --- tests/unit/button/button_tickets.js | 22 ++++++++++++++++++++++ ui/jquery.ui.button.js | 12 ++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/tests/unit/button/button_tickets.js b/tests/unit/button/button_tickets.js index 5c5053ded..79bbfeb5c 100644 --- a/tests/unit/button/button_tickets.js +++ b/tests/unit/button/button_tickets.js @@ -20,4 +20,26 @@ test( "#6262 - buttonset not applying ui-corner to invisible elements", function ok( set.find( "label:eq(2)" ).is( ".ui-button.ui-corner-right" ) ); }); +test( "#7092 - button creation that requires a matching label does not find label in all cases", function() { + var group = $( "" ); + group.find( "input:checkbox" ).button(); + ok( group.find( "label" ).is( ".ui-button" ) ); + + group = $( "