Skip to content

[Bug] CheckboxInput: description isn't part of the clickable label — clicking it doesn't toggle the checkbox #4132

Closed

Description

@cixzhang

Summary

On CheckboxInput, the description text is not part of the clickable label target — clicking the description does nothing, while clicking the label toggles the checkbox. For a checkbox, the label and its description should both be a clickable target that activates the input, so the whole text block behaves as one hit area.

Current behavior

FieldLabel renders the description as a sibling <span> outside the <label>:

<LabelElement htmlFor={inputID}>{labelContent}</LabelElement>
{description && (
  <span id={descriptionID} ...>{description}</span>
)}

Only labelContent is inside <label htmlFor={inputID}>, so:

  • Clicking the label text toggles the checkbox. ✅
  • Clicking the description text does nothing. ❌

The description is wired to the input via aria-describedby (good for screen-reader announcement), but it is not part of the click target.

Expected

Clicking anywhere in the checkbox's label region — label or description — toggles the checkbox. The description should be inside the label's clickable area (or otherwise associated so a click activates the input).

Why it matters

  • Hit target / Fitts's law: the description is often the larger block of text; users naturally click it expecting the checkbox to toggle.
  • Consistency: the label already toggles; the description sitting right beneath it looking identical but being inert is surprising.

Scope / caveat

This is specific to controls where the label names a single input (CheckboxInput, and likely Switch / RadioListItem — worth checking). It should not apply to group labels (e.g. a role="radiogroup" label rendered as a <span>, which intentionally has no htmlFor and must not wrap a single control). FieldLabel already distinguishes isGroupLabel, so the fix can be gated to the single-control case.

Also confirm links/interactive elements inside a description still work (nesting interactive content inside a <label> needs care) — if a description can contain a link, the association may need aria/click-forwarding rather than physically nesting it in the <label>.

Environment

  • Components: CheckboxInput (@astryxdesign/core); shared FieldLabel at packages/core/src/Field/FieldLabel.tsx

Activity

  1. added
    bug
    component
    on Jul 21, 2026
  2. cixzhang commented on Jul 28, 2026

    @cixzhang
    ContributorAuthor

    Tracked in the accessibility program tracker: #4475

  3. cixzhang commented on Jul 28, 2026

    @cixzhang
    ContributorAuthor

    Tracked in the accessibility program tracker: #4475

  4. added a commit that references this issue on Jul 31, 2026
    8c18bd2
  5. HelloOjasMutreja commented on Aug 1, 2026

    @HelloOjasMutreja
    Contributor

    Fixed by #4574 (merged). Description clicks now forward to the control via useInputContainer rather than nesting description in <label> (which would have caused accessible-name pollution — see that PR's description). Looks safe to close.

  6. cixzhang commented on Aug 2, 2026

    @cixzhang
    ContributorAuthor

    Resolved by #4574.

  7. added this to the 0.3.0 milestone on Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcomponent

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions