SC 2.5.3 Label in name and abbreviated text in dropdown list #4026
-
Hello, In a dropdown list where the visible labels use two-letter abbreviations for provinces, the "aria-label" attribute on each element provides the full name of the province. For example, the visible label might be "AB," and the aria-label is "Alberta." Would this be considered as a failure for the SC 2.5.3? Any thoughts or feedback would be appreciated. Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
That would clearly be a non-conformance because the visible label does not match, and is not a substring of, the accessible name. In practical terms, voice recognition software may not respond to commands like "click B C". You could achieve conformance by making the aria-label attributes include the two-letter abbreviations, such as aria-label="British Columbia BC". However, I think it's poor usability, so I would not recommend it unless there is some genuine reason why you can't display the full province name. |
Beta Was this translation helpful? Give feedback.
-
I don't think it's that simple. SC 2.5.3 requires the label and name of control elements to match, but makes no statements about the value of control elements. In your example there is only one label (“Province”) and many possible values in the option element. From an accessibility point of view, it would make sense to apply the rules of 2.5.3 to values as well, but the SC itself does not require this |
Beta Was this translation helpful? Give feedback.
-
the language is a bit looser than than, I'd say - in an open dropdown, every option can be interpreted as a distinct "user interface component" https://www.w3.org/TR/WCAG22/#dfn-user-interface-components so their visible value acts as the label https://www.w3.org/TR/WCAG22/#dfn-labels for that UIC |
Beta Was this translation helpful? Give feedback.
-
@patrickhlauke I don't mind interpreting it that way, but I read the SC differently, so a clarification in the Understanding would be good. Do you want to do that? |
Beta Was this translation helpful? Give feedback.
-
Thank you all for the quick responses. |
Beta Was this translation helpful? Give feedback.
That would clearly be a non-conformance because the visible label does not match, and is not a substring of, the accessible name. In practical terms, voice recognition software may not respond to commands like "click B C". You could achieve conformance by making the aria-label attributes include the two-letter abbreviations, such as aria-label="British Columbia BC". However, I think it's poor usability, so I would not recommend it unless there is some genuine reason why you can't display the full province name.