-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.5.3 Label in Name - aria-hidden on part of visual label #2302
Comments
IMO that is a technical failure of the test. I also find it frustrating that the required attribute on the input causes redundancy with the label. I don't think it's technically a failure to not have the required attribute, so taking out the attribute and your aria-hidden is probably the simplest thing to do and not fail WCAG.
I can't think of any negative to this (but I'm sure someone will contradict that!). The label is properly associated with the input and contains the word "required". So it is part of its accessible name and will be exposed. My sense is that the required attributed is great for increasing accessibility where text at the top of the page might say "All fields are required except those marked as 'not required'." If a screen reader user was to miss that qualifier, if you had the required attribute on your inputs, then the user would always hear when something was required. You may also be able to achieve a technical pass by keeping the required attribute and putting the "(required)" text outside the label element. |
I think that things that semantically do not belong to the label but are part of the I suspect that no one using voice input software will speak the "required" when trying to focus the input field. |
even trying to do that though: <label for=p>First name</label> (required)
<input id=p required> I can make the above still visually resemble the provided example. Where the same issue would still exist of what's the perceived label - including the "(required)" text might still be spoken, and then result in the field not being accessed for this instance. However, if that were to happen a prompt shows up and recommends I say "tap first name". Doing so, it works as expected for this revised example and the aria-hidden=true example. So in either case, I'd tend to agree with JAWS test's suggestion that maybe an exemption could be noted here? |
So I think you two are talking about some addition or modification at the least to this wording? Or maybe even an official exemption?
The challenge is going to be coming up with wording that overcomes the redundancy you want to eliminate, without exempting things one wishes to keep within scope. For example, there are several ways an author can indicate a required field:
I don't think you can be successful using only 1? That would work for a blind user or others using AT that surfaced the programmatic equivalent, but everyone else needs something to understand there's a required field. So I think it has to involve at least one of the others. In regard to the second and third option, I don't think one can categorically say either is the better way and I think either should pass. You could probably make a case that the fourth one is not meeting 3.3.2 Labels or Instructions but it would be debatable. So, if not using specific programmatic required indicators is acceptable, then we have to be really cautious about exempting any part of the label (real or perceived) that could jeopardize an accessible and usable implementation of number 3. Do either of you have suggestions on approach? |
@mbgower it is not about how to correctly label required fields, but only about whether the required indicator must be part of the AccName according to 2.5.3. |
Proposed working group answer: (Draft addition to understanding text)
|
For the "first name (required)" example, I'd add in the |
@JAWS-test With respect, I don't think that's an easy thing to separate. In the past, we would have failed an implementation like this, because 1.3.1 is failing to include the visual indicator "(required)" programmatically.
Similar to @fstrr's comment, I feel there is a real problem with passing the first bulleted example in its current form. If it doesn't have aria-required set (which it doesn't technically need), then excluding the "(required)" from the accessible name would actually cause this construction not to surface the text indicator of a required field to AT. |
Entirely agree - these were not full code examples, I assumed that the first input would have a Also, we probably need something like:
|
I think this issue is raising a real problem with the SC, and we should tread carefully in how we attempt to resolve :) I wonder how many other situations there are where the label is potentially redundant to (or even in conflict with) a programmatically set name/role/value
Maybe this is orthogonal to label in name, but i think you see what I'm getting at. |
@mbgower yes, it potentially opens a can of worms... but there are a number of situations where the strict adherence to the letter of 2.5.3 seems to have undesirable results. |
Returning to the Understanding document, I think there is 'okay' support for this construct in the existing language. We can maybe fit this into the Punctuation and capitalization subsection of the Understanding document with the addition of a new paragraph something like:
@joe-watkins @scottaohara @detlev would that work from your perspective? |
@mbgower Yes, I think that would be useful. BTW is 'input mask' still in use? It has a dated feel somehow, but I am not a native speaker. Would it be too restrictive to constrain that to additional info in parentheses, though? If not, there should be examples what is and what is not "clearly separated visually and semantically". For example, what about an informal style like
would the hyphen qualify? |
@joe-watkins @scottaohara @detlev |
@mraccess77 Could you take a look through, after the discussion in the meeting? |
From the WCAG meeting today, we've approved the change, but would like a review from ACT prior to merging. Pinging @WilcoFiers as I can't find the account for Kathy, could you pass this on please? |
did this get a chance to be reviewed? |
@scottaohara I have added PR #2725 as a draft in the WCAG 2 project, so it should be reviewed shortly. @kengdoj this was approved at a WCAG meeting almost a year ago, but i believe held up because we were waiting for an ACT review prior to merge. Are you able to review and comment on the PR? |
Hello :)
I'd love to get a take from the working group on if folks feel this scenario is a failure of 2.5.3 Label in Name. It's a real head-scratcher. Does it pass the test steps found in F96?
The intent within the code is to try to avoid the double announcement of 'required' with a screen reader by hiding that in the visual label with
aria-hidden
and instead relying on that from therequired
attribute.I've noticed that with some voice recognition software (iOS Voice Access & macOS Voice Control) if one says "Tap, First name required" it doesn't work as expected and fallbacks must be used. So the screen reader win may impact some voice recognition a bit.
Please excuse best practice / usability - strictly WCAG failure consideration here.
The text was updated successfully, but these errors were encountered: