Open kengdoj opened 3 weeks ago
While not part of Section 508 since it is WCAG 2.1, and this SC is for controls, Understanding 2.5.3 Label in Name, under Intent:
In order for the label text and accessible name to be matched, it is first necessary to determine which text on the screen should be considered a label for any given control. There are often multiple text strings in a user interface that may be relevant to a control. However, there are reasons why it is best to conservatively interpret the label as being only the text in close proximity.
Conventionally the label for user interface components is the adjacent text string. The typical positioning for left to right languages is:
- immediately to the left of comboboxes, dropdown lists, text inputs, and other widgets (or in the absence of left-side labels, immediately above and aligned with the left edge of each input)
- immediately to the right of checkboxes and radio buttons
- inside buttons and tabs or immediately below icons serving as buttons
The rationale for some of these conventions is explained in G162: Positioning labels to maximize predictability of relationships.
It is important to bias towards treating only the adjacent text as a label because liberal interpretations of what constitutes a text label can jeopardize the value of this Success Criterion (SC) by lessening predictability. Isolating the label to the single string in close proximity to the component makes it easier for developers, testers, and end users to identify the label targeted for evaluation in this SC. Predictable interpretation of labeling allows users of speech recognition technologies to interact with the element via its conventionally positioned label, and allows users of screen reading technologies to enjoy consistency between the nearby visible label and the announced name of the component.
Example: A form field is meant to be for a date input (based on data validation and general context on the page) but has a visible label of "Form Field 1."
(Please provide explanation of your results.)