Skip to content

a11y: associate shared Input and Select labels with their controls #39

Description

@McanKul

Goal

Make the shared Input and Select labels programmatically associated with their controls.

Acceptance criteria

  • Generate a stable ID with useId when neither an explicit ID nor suitable name is provided.
  • Each label.htmlFor matches its control ID.
  • Explicit IDs and existing name behavior remain supported.
  • Adjacent controls receive unique IDs.
  • Add focused render tests for both components.

Files

  • src/components/ui/Input.tsx
  • src/components/ui/Select.tsx
  • New src/components/ui/FormControls.test.tsx

Verification

  • npm test -- src/components/ui/FormControls.test.tsx
  • npm run typecheck

Metadata

Metadata

Assignees

No one assigned

    Labels

    accessibilityAccessibility improvementsgood first issueGood for newcomerstestsTest coverage and test infrastructure

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions