Skip to content

Bug: Lit Checkbox uses .value instead of .checked - breaks visual state and data binding #458

@shantoislamdev

Description

@shantoislamdev

The Lit checkbox component incorrectly uses .value instead of .checked for rendering and event handling, causing the checkbox to never display its checked state and write incorrect values to the data model.

Bug Location

  • File: renderers/lit/src/0.8/ui/checkbox.ts
  • Lines: 96, 100

Current (Broken) Behavior

// Line 100 - Sets string value, NOT checked state
.value=${value}

// Line 96 - Reads string value, NOT checked state  
this.#setBoundValue(evt.target.value);

Problems:

  1. .value=${true} sets inputElement.value = "true" (string) but does NOT visually check the checkbox
  2. evt.target.value returns the same string on every click, regardless of checked/unchecked state
  3. Data model receives string instead of boolean, corrupting the expected type

Expected Behavior (per Angular reference implementation)

// Angular checkbox.ts:32 - Correct
[checked]="inputChecked()"

// Angular checkbox.ts:71 - Correct
event.target.checked

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions