Make checkedValue and uncheckedValue mandatory for Checkbox component

Aperta
#1,874 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@rismehta ci sta già lavorando.

Dal 6/5/2026.

  • #1875 di @vdua — chiusa senza merge

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Problem

The checkbox component definition marks checkedValue and uncheckedValue as required: false with no default value. This means a checkbox can be authored and validated successfully without specifying what value it submits when checked or unchecked.

When neither property is set, AEM Core Components fall back to submitting the HTML default "on" when the checkbox is ticked. This is silent and non-obvious — the form validates, the field renders, and required: true guards against skipping it, but the submitted value is undefined/unpredictable unless the author explicitly sets checkedValue.

Impact

  • Form authors can create checkbox fields that pass schema validation but submit an implementation-specific default ("on") instead of a meaningful domain value (e.g. "true", "agreed").
  • Back-end submission processors that check for a specific string value will silently miss, with no authoring-time warning.
  • Tooling that generates component payloads from a spec (e.g. AI-assisted authoring) has no signal to prompt for these values.

Proposed Solution

Mark checkedValue as required: true in the checkbox component definition. Optionally also require uncheckedValue when enableUncheckedValue is true.

This would cause validate-patch and the AEM dialog to surface missing values at authoring time rather than silently falling back to "on".

Component

core/fd/components/form/checkbox/v1/checkbox
Definition field: ./checkedValue — currently required: false, no default

Lingua principale
JavaScript
Stelle
36
Fork
62
Merge medio
8h 36m
PR unite (30g)
12

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di adobe/aem-core-forms-components

Tutte le issue di adobe/aem-core-forms-components

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.