Skip to content

Commit 1860203

Browse files
committed
[material-ui][FormControlLabel] Add missing labelPlacementEnd class
1 parent 58cfb57 commit 1860203

4 files changed

Lines changed: 28 additions & 0 deletions

File tree

docs/pages/material-ui/api/form-control-label.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@
8383
"description": "Styles applied to the root element if `labelPlacement=\"bottom\"`.",
8484
"isGlobal": false
8585
},
86+
{
87+
"key": "labelPlacementEnd",
88+
"className": "MuiFormControlLabel-labelPlacementEnd",
89+
"description": "Styles applied to the root element if `labelPlacement=\"end\"`.",
90+
"isGlobal": false
91+
},
8692
{
8793
"key": "labelPlacementStart",
8894
"className": "MuiFormControlLabel-labelPlacementStart",

docs/translations/api-docs/form-control-label/form-control-label.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@
5656
"nodeName": "the root element",
5757
"conditions": "<code>labelPlacement=\"bottom\"</code>"
5858
},
59+
"labelPlacementEnd": {
60+
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
61+
"nodeName": "the root element",
62+
"conditions": "<code>labelPlacement=\"end\"</code>"
63+
},
5964
"labelPlacementStart": {
6065
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
6166
"nodeName": "the root element",

packages/mui-material/src/FormControlLabel/FormControlLabel.test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,20 @@ describe('<FormControlLabel />', () => {
130130
expect(container.firstChild).to.have.class(classes.labelPlacementStart);
131131
});
132132

133+
it('should have the `end` class', () => {
134+
const { container } = render(
135+
<FormControlLabel label="Pizza" labelPlacement="end" control={<div />} />,
136+
);
137+
138+
expect(container.firstChild).to.have.class(classes.labelPlacementEnd);
139+
});
140+
141+
it('should have the `end` class by default', () => {
142+
const { container } = render(<FormControlLabel label="Pizza" control={<div />} />);
143+
144+
expect(container.firstChild).to.have.class(classes.labelPlacementEnd);
145+
});
146+
133147
it('should have the `top` class', () => {
134148
const { container } = render(
135149
<FormControlLabel label="Pizza" labelPlacement="top" control={<div />} />,

packages/mui-material/src/FormControlLabel/formControlLabelClasses.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ export interface FormControlLabelClasses {
66
root: string;
77
/** Styles applied to the root element if `labelPlacement="start"`. */
88
labelPlacementStart: string;
9+
/** Styles applied to the root element if `labelPlacement="end"`. */
10+
labelPlacementEnd: string;
911
/** Styles applied to the root element if `labelPlacement="top"`. */
1012
labelPlacementTop: string;
1113
/** Styles applied to the root element if `labelPlacement="bottom"`. */
@@ -33,6 +35,7 @@ const formControlLabelClasses: FormControlLabelClasses = generateUtilityClasses(
3335
[
3436
'root',
3537
'labelPlacementStart',
38+
'labelPlacementEnd',
3639
'labelPlacementTop',
3740
'labelPlacementBottom',
3841
'disabled',

0 commit comments

Comments
 (0)