Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Labels are not connected to inputs in code examples #825

Open
@Kolombiken

Description

@Kolombiken

The Problem

When using a screenreader the labels for the inputs are not announced since they are not connected to the form-fields. This means that forms are very hard to fill in for screenreader-users. I.e. one tested input filled with a label "first name" was announced as "edit text". This is a problem because people do copy/paste code examples and might not correct this in their applications.

Steps to Reproduce

Try https://codepen.io/davidkpiano/pen/yJwmEa with a screenreader. Using Mac this can be tested with VoiceOver and Safari.

Expected Behavior

Labels should be connected to inputs via the for-attribute that connects to the id on the input (explicit label) or wrapped around the input (implicit label) More info on accessible forms

Actual Behavior

Labels are missing the for-attribute and are not connected to an id on the input

Reproducible Code Example

this CodePen template is a good example :)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions