File tree 2 files changed +16
-2
lines changed
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,20 @@ test("radio groups", function() {
53
53
assert ( ":eq(1)" , ":eq(0)" , ":eq(0)" ) ;
54
54
} ) ;
55
55
56
+ test ( "radio groups - ignore elements with same name" , function ( ) {
57
+ expect ( 1 ) ;
58
+ var form = $ ( "form:first" ) ,
59
+ radios = form . find ( "[type=radio]" ) . button ( ) ,
60
+ checkbox = $ ( "<input>" , {
61
+ type : "checkbox" ,
62
+ name : radios . attr ( "name" )
63
+ } ) ;
64
+
65
+ form . append ( checkbox ) ;
66
+ radios . button ( "refresh" ) ;
67
+ ok ( true , "no exception from accessing button instance of checkbox" ) ;
68
+ } ) ;
69
+
56
70
test ( "input type submit, don't create child elements" , function ( ) {
57
71
expect ( 2 ) ;
58
72
var input = $ ( "#submit" ) ;
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ var lastActive,
40
40
if ( name ) {
41
41
name = name . replace ( / ' / g, "\\'" ) ;
42
42
if ( form ) {
43
- radios = $ ( form ) . find ( "[name='" + name + "']" ) ;
43
+ radios = $ ( form ) . find ( "[name='" + name + "'][type=radio] " ) ;
44
44
} else {
45
- radios = $ ( "[name='" + name + "']" , radio . ownerDocument )
45
+ radios = $ ( "[name='" + name + "'][type=radio] " , radio . ownerDocument )
46
46
. filter ( function ( ) {
47
47
return ! this . form ;
48
48
} ) ;
You can’t perform that action at this time.
0 commit comments