Skip to content

Aria-LabelledBy is not getting set on TextField when the label is set #9133

@SavannahBourgeois

Description

@SavannahBourgeois

Codepen demonstrating the issue

https://codepen.io/savannahbourgeois/pen/LoLNMR

Actual behavior:

The label indicates "for" the input. But the input does not say it is aria-labelledby the label.

Expected behavior:

It's mostly correct, the input should also have an aria-labelledby with the value set to the id of the label. This will give us the best chance for the input to be read out correctly by the broadest range of browsers and screen readers.

Documentation describing expected behavior

Not all ATs use "for" so we should account for older ones that only use aria-labelledby. Tagging @jspurlin since he asked.
https://www.w3.org/WAI/PF/aria-1.1/states_and_properties#aria-labelledby

aria-labelledby

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions