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

Search field is missing a label #10

Open
LJWatson opened this issue Jun 16, 2017 · 0 comments
Open

Search field is missing a label #10

LJWatson opened this issue Jun 16, 2017 · 0 comments
Labels
a11y Accessibility improvements a11y-tracker Group bringing to attention of a11y, or tracked by the a11y Group but not needing response. bug Something does not work as it should (as opposed to “it could be improved”) mock-up-1 About our first iteration (released ~ 20 Mar 2018)

Comments

@LJWatson
Copy link

The search field on mockup1 does not have an associated label (needed to indicate to screen reader users what the field is for).

<div id="search-form">
<input tabindex="3" class="text" name="q" title="Search"> <button id="search-submit" name="search-submit" type="submit"><img class="submit" src="https://www.w3.org/2008/site/images/search-button" alt="Search" height="17" width="21"></button>
</div>

On the assumption that the <button> element contains an image that provides an adequate visual label for the text field, use the title attribute on the <input> to provide a label specifically for screen reader users.

<div id="search-form">
<input title="Search" tabindex="3" class="text" name="q" title="Search"> <button id="search-submit" name="search-submit" type="submit"><img class="submit" src="https://www.w3.org/2008/site/images/search-button" alt="Search" height="17" width="21"></button>
</div>

It would also be good to add the search role to the containing <div> element. This will create a landmark for screen reader users to navigate to.

<div role="search" id="search-form">
<input title="Search" tabindex="3" class="text" name="q" title="Search"> <button id="search-submit" name="search-submit" type="submit"><img class="submit" src="https://www.w3.org/2008/site/images/search-button" alt="Search" height="17" width="21"></button>
</div>
@tripu tripu added bug Something does not work as it should (as opposed to “it could be improved”) mock-up-1 About our first iteration (released ~ 20 Mar 2018) a11y Accessibility improvements labels Apr 12, 2018
@tripu tripu added this to the Next cycle milestone Apr 12, 2018
@plehegar plehegar added the a11y-tracker Group bringing to attention of a11y, or tracked by the a11y Group but not needing response. label Feb 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Accessibility improvements a11y-tracker Group bringing to attention of a11y, or tracked by the a11y Group but not needing response. bug Something does not work as it should (as opposed to “it could be improved”) mock-up-1 About our first iteration (released ~ 20 Mar 2018)
Projects
None yet
Development

No branches or pull requests

3 participants