Skip to content

Commit ecf24c1

Browse files
wintercountern1k0
authored andcommitted
Wrap radio and checkbox labels into span to enable styling. (rjsf-team#428)
* Wrap radio and checkbox labels into span to enable styling. * Wrap radio and checkbox labels into span to enable styling. Update test.
1 parent 1a556a3 commit ecf24c1

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/components/widgets/CheckboxWidget.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function CheckboxWidget({
2121
disabled={disabled}
2222
autoFocus={autofocus}
2323
onChange={(event) => onChange(event.target.checked)}/>
24-
<strong>{label}</strong>
24+
<span>{label}</span>
2525
</label>
2626
</div>
2727
);

src/components/widgets/CheckboxesWidget.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function CheckboxesWidget(props) {
3636
onChange(deselectValue(option.value, value));
3737
}
3838
}}/>
39-
{option.label}
39+
<span>{option.label}</span>
4040
</span>
4141
);
4242
return inline ? (

src/components/widgets/RadioWidget.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function RadioWidget({
2929
disabled={disabled}
3030
autoFocus={autofocus && i === 0}
3131
onChange={_ => onChange(option.value)}/>
32-
{option.label}
32+
<span>{option.label}</span>
3333
</span>
3434
);
3535

test/BooleanField_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe("BooleanField", () => {
3333
title: "foo"
3434
}});
3535

36-
expect(node.querySelector(".field label strong").textContent)
36+
expect(node.querySelector(".field label span").textContent)
3737
.eql("foo");
3838
});
3939

0 commit comments

Comments
 (0)