Skip to content

Commit

Permalink
Add form field title for a11y (#542)
Browse files Browse the repository at this point in the history
* Add input title to improve a11y

Resolves pa11y error:

```
 • Error: This form field should be labelled in some way. Use the label element (either with a "for" attribute or wrapped around the form field), or "title", "aria-label" or "aria-labelledby" attributes as appropriate.
   ├── WCAG2AA.Principle1.Guideline1_3.1_3_1.F68
   ├── #search_input_react
   └── <input type="text" id="search_input_react" placeholder="Search" aria-label="Search" class="aa-input" autocomplete="off" spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="false" aria-labelledby="search_input_react" aria-owns="...
```

* Fix Prettier failure on Circle CI
  • Loading branch information
amyrlam authored and JoelMarcey committed Apr 10, 2018
1 parent 71317e4 commit 80ece69
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/core/nav/HeaderNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,12 @@ class HeaderNav extends React.Component {
// return algolia search bar
return (
<li className="navSearchWrapper reactNavSearchWrapper" key="search">
<input id="search_input_react" type="text" placeholder="Search" />
<input
id="search_input_react"
type="text"
placeholder="Search"
title="Search"
/>
</li>
);
} else if (link.languages) {
Expand Down

0 comments on commit 80ece69

Please sign in to comment.