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

[A11Y] Missing accessible label and landmark role on search input #2667

Closed
Tracked by #3360
davwheat opened this issue Mar 7, 2021 · 0 comments · Fixed by #2669
Closed
Tracked by #3360

[A11Y] Missing accessible label and landmark role on search input #2667

davwheat opened this issue Mar 7, 2021 · 0 comments · Fixed by #2669
Assignees
Labels
type/accessibility Issues relating to accessibility (keyboard navigation, screenreaders, text contrast, etc.)
Milestone

Comments

@davwheat
Copy link
Member

davwheat commented Mar 7, 2021

Bug Report

Current Behavior
There is no accessible label on the Search input, and the landmark search role is missing.

Placeholders should never be used in place of real landmarked elements, such as a <label>. This is because they prevent users with assistive technologies from selecting the input by voice control.

While placeholder text provides valuable guidance for many users, placeholder text is not a replacement for labels. Assistive technologies, such as screen readers, do not treat placeholder text as labels.

Possible Solution
The W3 consortium recommend using hidden <label>s for inputs where we don't want to visibly display the label to the user, as these allow assistive tech to still use them.

A label for a form control helps everyone better understand its purpose. In some cases, the purpose may be clear enough from the context when the content is rendered visually. The label can be hidden visually, though it still needs to be provided within the code to support other forms of presentation and interaction, such as for screen reader and speech input users.

However, in this scenario, using aria-label on the <input> is far easier, and also suggested as a possible approach for hiding label text

Source: https://www.w3.org/WAI/tutorials/forms/labels/#hidden

@davwheat davwheat added the type/accessibility Issues relating to accessibility (keyboard navigation, screenreaders, text contrast, etc.) label Mar 15, 2021
@davwheat davwheat changed the title [A11Y] Missing accessible label on search input [A11Y] Missing accessible label and landmark role on search input Mar 15, 2021
@davwheat davwheat self-assigned this Mar 15, 2021
@davwheat davwheat added this to the 0.1 milestone Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/accessibility Issues relating to accessibility (keyboard navigation, screenreaders, text contrast, etc.)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant