Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 55093ee

Browse files
kvizcarracopybara-github
authored andcommitted
feat(formfield): Add mdc-label class to <label>
PiperOrigin-RevId: 520396029
1 parent ed7e82d commit 55093ee

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/mdc-form-field/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Use the `mdc-form-field` element to wrap any combination of adjacent _input_ and
3737
...
3838
</div>
3939
</div>
40-
<label for="my-checkbox">This is my checkbox</label>
40+
<label class="mdc-label" for="my-checkbox">This is my checkbox</label>
4141
</div>
4242
```
4343

@@ -72,7 +72,7 @@ By default, the input will be positioned before the label. You can position the
7272
...
7373
</div>
7474
</div>
75-
<label for="my-checkbox">This is my checkbox</label>
75+
<label class="mdc-label" for="my-checkbox">This is my checkbox</label>
7676
</div>
7777
```
7878

@@ -88,15 +88,15 @@ If the label text is too long for a single line, it will wrap the text by defaul
8888
...
8989
</div>
9090
</div>
91-
<label for="my-checkbox">This some really really really long text</label>
91+
<label class="mdc-label" for="my-checkbox">This some really really really long text</label>
9292
</div>
9393
```
9494

9595
## `MDCFormField` Properties and Methods
9696

9797
Property | Value Type | Description
9898
--- | --- | ---
99-
`input` | String | Gets and sets the form field input.
99+
`input` | String | Gets and sets the form field input.
100100

101101
In order for the label ripple integration to work correctly, the `input` property needs to be set to a valid instance of an MDC Web input element which exposes a `ripple` getter. No action is taken if the `input` property is not set or the input instance doesn't expose a `ripple` getter.
102102

packages/mdc-form-field/test/component.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function getFixture() {
2929
return createFixture(html`
3030
<div class="mdc-form-field">
3131
<input type="radio" id="radio" checked name="radio">
32-
<label for="radio">Foo</label>
32+
<label class="mdc-label" for="radio">Foo</label>
3333
</div>
3434
`);
3535
}

0 commit comments

Comments
 (0)