Skip to content

Rule 2ee8b8 ("Visible label is part of accessible name"): adding label text as part of visible label for labelable elements #2236

@shunguoy

Description

@shunguoy

Using label elements to associate text labels with form controls (e.g., radio, checkbox) is common, and may be required by WCAG. If a labeled element doesn't have a valid aria-label or aria-labelledby attribute, the text from the label element can be used as an accessible name. However, suppose a labeled element has an aria-label or aria-labelledby attribute. In that case, the accessible name is calculated from the aria-label or aria-labelledby, and this rule should be triggered (with an error) if the label text is not part of the accessible name.
For example,
email:

Also, refer to #2075 for more discussions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions