sarapis / orservices

ORServices is an open source, smartphone-friendly directory application that enables you to collect, verify, organize and share information about social services in your community with your stakeholders, beneficiaries, partner organizations and more.
https://sarapis.org/human-services/orservices/
22 stars 16 forks source link

Add form labels to inputs for accessibility #68

Open HaSistrunk opened 3 years ago

HaSistrunk commented 3 years ago

Is your feature request related to a problem? Please describe.

Input fields should have a description that is explicitly associated with the field to make sure that users of assistive technologies will know what the field is for. Placeholder text (eg. "Search for service") is not a replacement for labels, since it disappears once the input is selected and has low color contrast (See this article on placeholders and accessibility).

I'm seeing this issue in:

Looks perfect on the /contacts and /facilities pages for search inputs!

Describe the solution you'd like

I'd suggest one of two solutions:

  1. Replace placeholder text with visible <label> elements above the input
  2. Add <label> elements that are hidden from sighted users, but will be read by assistive tech.

Also, link labels to their inputs in the markup. See markup examples for implementation on the A11y Style Guide.

For CSS to create a .visually-hidden class that is accessible to screen readers, see this article from The A11y Project on how to hide content.

Additional context

This accessibility guideline is specified in WCAG 2.x Level A (SC 3.3.2)