Skip to content

fix(z-input): add aria-required to required checkboxes#627

Open
ada-workbackai wants to merge 1 commit intomasterfrom
workbackai/fix/wcag-1.3.1-checkbox-required-indicator
Open

fix(z-input): add aria-required to required checkboxes#627
ada-workbackai wants to merge 1 commit intomasterfrom
workbackai/fix/wcag-1.3.1-checkbox-required-indicator

Conversation

@ada-workbackai
Copy link
Copy Markdown
Contributor

Summary

Fixes WCAG 1.3.1 (Info and Relationships) by ensuring checkbox inputs programmatically indicate their required status through the aria-required attribute.

Issue: Required checkboxes in the registration form lack programmatic indicators of their required status. Screen reader users cannot determine which checkboxes are mandatory, forcing them to use trial-and-error to discover form requirements.

Solution: Modified the z-input component to automatically add aria-required="true" when the required prop is set on checkbox inputs. This ensures both the HTML5 required attribute and ARIA aria-required attribute are present for maximum accessibility compatibility.

Changes

  • src/components/z-input/index.tsx: Added aria-required="true" to checkbox inputs when required prop is true
  • src/components/z-input/test-checkbox.spec.ts: Added unit test verifying aria-required is applied to required checkboxes

Test Plan

  • Added unit test for required checkbox with aria-required attribute
  • Verified existing checkbox tests still pass
  • Manually tested with screen reader (VoiceOver/NVDA) to confirm required status is announced
  • Verified visual appearance is unchanged

Impact

This fix applies to all checkboxes rendered with <z-input type="checkbox" required> across all applications using the design system, including:

  • Registration forms (student, teacher, professional)
  • Consent forms
  • Any other forms with required checkbox fields

Evidence

View before/after screenshots and full audit details:
https://app.workback.ai/dashboard/issue/5054/


WCAG Reference:
1.3.1 Info and Relationships

Ensures checkbox inputs programmatically indicate required status by adding aria-required="true" when the required prop is set. This improves accessibility for screen reader users who need to know which form fields are mandatory.

Fixes WCAG 1.3.1 (Info and Relationships) violation where required checkboxes lacked programmatic indicators of their required status.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant