Skip to content

Commit d8f5315

Browse files
author
shanroislamdev
committed
fix(lit): use .checked instead of .value in checkbox component
The checkbox component incorrectly used .value (string) instead of .checked (boolean) for both display binding and event handling: - Changed .value=\ to .checked=\ for property binding - Changed evt.target.value to evt.target.checked in event handler - Updated #setBoundValue signature from string to boolean This aligns the Lit implementation with the Angular reference implementation and the A2UI protocol specification which states checkbox value should be 'true for checked, false for unchecked'.
1 parent dbc4187 commit d8f5315

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

renderers/lit/src/0.8/ui/checkbox.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class Checkbox extends Root {
5757
`,
5858
];
5959

60-
#setBoundValue(value: string) {
60+
#setBoundValue(value: boolean) {
6161
if (!this.value || !this.processor) {
6262
return;
6363
}
@@ -93,11 +93,11 @@ export class Checkbox extends Root {
9393
return;
9494
}
9595
96-
this.#setBoundValue(evt.target.value);
96+
this.#setBoundValue(evt.target.checked);
9797
}}
9898
id="data"
9999
type="checkbox"
100-
.value=${value}
100+
.checked=${value}
101101
/>
102102
<label class=${classMap(this.theme.components.CheckBox.label)} for="data"
103103
>${this.label?.literalString}</label

0 commit comments

Comments
 (0)