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

Commit

Permalink
feat(formfield): Add mdc-label class to <label>
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 520396029
  • Loading branch information
kvizcarra authored and copybara-github committed Mar 29, 2023
1 parent ed7e82d commit 55093ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/mdc-form-field/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Use the `mdc-form-field` element to wrap any combination of adjacent _input_ and
...
</div>
</div>
<label for="my-checkbox">This is my checkbox</label>
<label class="mdc-label" for="my-checkbox">This is my checkbox</label>
</div>
```

Expand Down Expand Up @@ -72,7 +72,7 @@ By default, the input will be positioned before the label. You can position the
...
</div>
</div>
<label for="my-checkbox">This is my checkbox</label>
<label class="mdc-label" for="my-checkbox">This is my checkbox</label>
</div>
```

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

## `MDCFormField` Properties and Methods

Property | Value Type | Description
--- | --- | ---
`input` | String | Gets and sets the form field input.
`input` | String | Gets and sets the form field input.

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.

Expand Down
2 changes: 1 addition & 1 deletion packages/mdc-form-field/test/component.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function getFixture() {
return createFixture(html`
<div class="mdc-form-field">
<input type="radio" id="radio" checked name="radio">
<label for="radio">Foo</label>
<label class="mdc-label" for="radio">Foo</label>
</div>
`);
}
Expand Down

0 comments on commit 55093ee

Please sign in to comment.