You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Design (per the /engineering:system-design request): many forms mark
required fields visually — a `*` or "(required)" next to the label —
as a UX convention. When that visual promise isn't backed by an
actual `required`/`aria-required="true"` attribute, the field is
silently optional: native validation won't block submission, screen
readers won't announce it as required, and a user who skips it
(believing the visual cue, since that's the whole point of it) can
submit incomplete data with zero error. This happens when a design
system's "required" visual styling gets wired up independently of the
real validation attribute.
check_required_indicator_mismatch resolves each field's own label
text, tests it for a required-looking signal (`*` or the word
"required"), and flags any match whose field lacks both `required` and
`aria-required="true"`. Not what axe-core's label rule checks (that's
about a label existing, not about a required-looking one being
honored), and not covered by any of the other nine checks. Always a
Fail: the field's own label contradicts its own enforcement, which is
objectively verifiable rather than a heuristic guess.
fixtures/required-indicator-mismatch-form.html covers all three cases
in one fixture: "Full name *" (the bug — no required attribute),
"Email *" (the correctly-wired case, proving no false positive), and
"Comments" (no required-looking label at all, irrelevant either way).
Verified both directions by mutation: forced isRequired to always be
true (confirmed the Fail test caught the resulting false negative),
then forced it to always be false (confirmed the "Email must not be
flagged" assertion caught the resulting false positive), before
restoring the real logic.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0 commit comments