Skip to content

Commit

Permalink
fix(forms): fix form association for switch, checkbox, and radio, inc…
Browse files Browse the repository at this point in the history
…luding label activation

PiperOrigin-RevId: 507004348
  • Loading branch information
material-web-copybara authored and copybara-github committed Feb 3, 2023
1 parent e15c4b8 commit 1ddba0c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions checkbox/lib/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import {MdRipple} from '../../ripple/ripple.js';
* A checkbox component.
*/
export class Checkbox extends LitElement {
/**
* @nocollapse
*/
static formAssociated = true;

/**
Expand Down
3 changes: 3 additions & 0 deletions radio/lib/radio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export class Radio extends LitElement {
static override shadowRootOptions:
ShadowRootInit = {...LitElement.shadowRootOptions, delegatesFocus: true};

/**
* @nocollapse
*/
static formAssociated = true;

/**
Expand Down
3 changes: 3 additions & 0 deletions switch/lib/switch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export class Switch extends LitElement {
static override shadowRootOptions:
ShadowRootInit = {mode: 'open', delegatesFocus: true};

/**
* @nocollapse
*/
static formAssociated = true;

/**
Expand Down

0 comments on commit 1ddba0c

Please sign in to comment.