Skip to content
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

Duplicate accName Confusion in Forms Tutorial #700

Open
aardrian opened this issue Oct 11, 2022 · 2 comments
Open

Duplicate accName Confusion in Forms Tutorial #700

aardrian opened this issue Oct 11, 2022 · 2 comments
Assignees

Comments

@aardrian
Copy link

Issue

The Hiding label text section of the Labeling Controls forms tutorial uses duplicate accNames for two different controls that are part of the same form.

WCAG Notes

This has caused confusion about what is the visible label for the text box in the context of the following SCs:

I am using the passive voice with "has caused confusion" because these SCs and comments came my way from non-practitioners more than once, each from assorted places (clients).

Interaction Bits

With voice control, when a user tries to select the Search button they are prompted to choose whether they meant the input or the button.

Screen reader elements lists at least disambiguate between buttons and text fields.

Suggested Change(s)

Change the accName of the text fields to "Keywords".

Code Changes

So Approach 1 (why is that part of the heading CSS generated content anyway?):

<label for="search" class="visuallyhidden">Search: </label>
<input type="text" name="search" id="search">
<button type="submit">Search</button>

Would become:

<label for="search" class="visuallyhidden">Keywords: </label>
<input type="text" name="search" id="search">
<button type="submit">Search</button>

Approach 2 would go from:

<input type="text" name="search" aria-label="Search">
<button type="submit">Search</button>

To:

<input type="text" name="search" aria-label="Keywords">
<button type="submit">Search</button>

And Approach 3 would go from:

<input type="text" name="search" aria-labelledby="searchbutton">
<button id="searchbutton" type="submit">Search</button>

To:

<span id="fakeLabel">Keywords: </span>
<input type="text" name="search" aria-labelledby="fakeLabel">
<button id="searchbutton" type="submit">Search</button>

I am pretending Approach 4 does not exist. Not very mature of me, but whatever.

Maybe Language Changes

  • Adjust the guidance to qualify that as a search form it gets some allowance on missing visible text from the commonly understood pattern. Or don't use a search form.
  • Identify the button label as not the same as the text box.
  • Identify that the text field would not pass 2.5.3, but instead 2.5.3 does not apply.
@brianelton
Copy link
Collaborator

Suggested fixes in PR #596 can be updated at the same time as this

@brianelton
Copy link
Collaborator

Will look at section on the use of title for labeleing, as noted in #341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants