From 1860203824d0096683cbff4378115abff8864012 Mon Sep 17 00:00:00 2001 From: siriwatknp Date: Wed, 22 Jul 2026 14:28:07 +0700 Subject: [PATCH] [material-ui][FormControlLabel] Add missing labelPlacementEnd class --- docs/pages/material-ui/api/form-control-label.json | 6 ++++++ .../form-control-label/form-control-label.json | 5 +++++ .../src/FormControlLabel/FormControlLabel.test.js | 14 ++++++++++++++ .../FormControlLabel/formControlLabelClasses.ts | 3 +++ 4 files changed, 28 insertions(+) diff --git a/docs/pages/material-ui/api/form-control-label.json b/docs/pages/material-ui/api/form-control-label.json index fb409742c6e9dc..a1de1fff46eb2c 100644 --- a/docs/pages/material-ui/api/form-control-label.json +++ b/docs/pages/material-ui/api/form-control-label.json @@ -83,6 +83,12 @@ "description": "Styles applied to the root element if `labelPlacement=\"bottom\"`.", "isGlobal": false }, + { + "key": "labelPlacementEnd", + "className": "MuiFormControlLabel-labelPlacementEnd", + "description": "Styles applied to the root element if `labelPlacement=\"end\"`.", + "isGlobal": false + }, { "key": "labelPlacementStart", "className": "MuiFormControlLabel-labelPlacementStart", diff --git a/docs/translations/api-docs/form-control-label/form-control-label.json b/docs/translations/api-docs/form-control-label/form-control-label.json index 323f3de521880e..f28d9540b330f8 100644 --- a/docs/translations/api-docs/form-control-label/form-control-label.json +++ b/docs/translations/api-docs/form-control-label/form-control-label.json @@ -56,6 +56,11 @@ "nodeName": "the root element", "conditions": "labelPlacement=\"bottom\"" }, + "labelPlacementEnd": { + "description": "Styles applied to {{nodeName}} if {{conditions}}.", + "nodeName": "the root element", + "conditions": "labelPlacement=\"end\"" + }, "labelPlacementStart": { "description": "Styles applied to {{nodeName}} if {{conditions}}.", "nodeName": "the root element", diff --git a/packages/mui-material/src/FormControlLabel/FormControlLabel.test.js b/packages/mui-material/src/FormControlLabel/FormControlLabel.test.js index d2dea17c559c8b..598eb977bf3336 100644 --- a/packages/mui-material/src/FormControlLabel/FormControlLabel.test.js +++ b/packages/mui-material/src/FormControlLabel/FormControlLabel.test.js @@ -130,6 +130,20 @@ describe('', () => { expect(container.firstChild).to.have.class(classes.labelPlacementStart); }); + it('should have the `end` class', () => { + const { container } = render( + } />, + ); + + expect(container.firstChild).to.have.class(classes.labelPlacementEnd); + }); + + it('should have the `end` class by default', () => { + const { container } = render(} />); + + expect(container.firstChild).to.have.class(classes.labelPlacementEnd); + }); + it('should have the `top` class', () => { const { container } = render( } />, diff --git a/packages/mui-material/src/FormControlLabel/formControlLabelClasses.ts b/packages/mui-material/src/FormControlLabel/formControlLabelClasses.ts index 09cb34a5c23dac..5d0404834c7a03 100644 --- a/packages/mui-material/src/FormControlLabel/formControlLabelClasses.ts +++ b/packages/mui-material/src/FormControlLabel/formControlLabelClasses.ts @@ -6,6 +6,8 @@ export interface FormControlLabelClasses { root: string; /** Styles applied to the root element if `labelPlacement="start"`. */ labelPlacementStart: string; + /** Styles applied to the root element if `labelPlacement="end"`. */ + labelPlacementEnd: string; /** Styles applied to the root element if `labelPlacement="top"`. */ labelPlacementTop: string; /** Styles applied to the root element if `labelPlacement="bottom"`. */ @@ -33,6 +35,7 @@ const formControlLabelClasses: FormControlLabelClasses = generateUtilityClasses( [ 'root', 'labelPlacementStart', + 'labelPlacementEnd', 'labelPlacementTop', 'labelPlacementBottom', 'disabled',