Skip to content

Commit bba46da

Browse files
committed
fix(checkbox): add id to checkbox label (#19096)
1 parent 7c46746 commit bba46da

File tree

1 file changed

+2
-2
lines changed
  • packages/web-components/src/components/checkbox

1 file changed

+2
-2
lines changed

packages/web-components/src/components/checkbox/checkbox.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class CDSCheckbox extends FocusMixin(FormMixin(LitElement)) {
108108
* Specify a custom id for the checkbox
109109
*/
110110
@property({ reflect: true })
111-
id = '';
111+
id = 'checkbox';
112112

113113
/**
114114
* Specify whether the Checkbox is in an indeterminate state
@@ -267,7 +267,7 @@ class CDSCheckbox extends FocusMixin(FormMixin(LitElement)) {
267267
@change="${handleChange}"
268268
@click="${handleClick}" />
269269
<label
270-
for="checkbox"
270+
for="${ifDefined(id)}"
271271
part="label"
272272
class="${labelClasses}"
273273
title="${ifDefined(title)}">

0 commit comments

Comments
 (0)