dequelabs / dequelabs/axe-core

Improve remediation message for label rule for labels that use aria-labelledby

Open
#3,693 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.5k
Forks
933
Avg merge
2d 23h
Merged PRs (30d)
17

Description

For the following html (and others that are similar), the `label` rule fails due to a problem in Firefox / NVDA that causes label elements with `aria-labelledby` to not generate an accessible name. In JAWS / Chrome and VO / Safari, the label is correctly given an accessible name.

```html

hello world


```

However the remediation message for the failure does not help to actually fix the problem as all of the things it says to do already exist on the element. It is wrapped by an explicit label that uses `aria-labelledby` on an element that exists and is not empty. We should try to see if we can clarify the remediation message to say that this is a bug in screen readers and you should not use `aria-labelledby` on label elements for this reason.

> "Fix any of the following:
Form element does not have an implicit (wrapped)
Form element does not have an explicit
aria-label attribute does not exist or is empty
aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
Element has no title attribute
Element has no placeholder attribute
Element's default semantics were not overridden with role="none" or role="presentation""

Related pr: https://github.com/dequelabs/axe-core/pull/3688

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.