Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
Improve the screen reader experience for the header menu
Browse files Browse the repository at this point in the history
  • Loading branch information
andymantell committed Jan 29, 2022
1 parent 5a7263f commit ff9319d
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions src/govuk/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,21 @@ function Header(props) {

{navigation ? (
<>
<button
type="button"
className="govuk-header__menu-button govuk-js-header-toggle"
aria-controls="navigation"
aria-label={menuButtonLabel}
<nav
className={`govuk-header__navigation ${
navigationClassName || ''
}`}
aria-label={navigationLabel}
>
Menu
</button>
<nav>
<ul
id="navigation"
className={`govuk-header__navigation ${
navigationClassName || ''
}`}
aria-label={navigationLabel}
<button
type="button"
className="govuk-header__menu-button govuk-js-header-toggle"
aria-controls="navigation"
aria-label={menuButtonLabel}
>
Menu
</button>
<ul id="navigation" className="govuk-header__navigation-list">
{navigation.map((item, index) => {
const {
active: itemActive,
Expand Down Expand Up @@ -177,8 +176,8 @@ function Header(props) {
Header.defaultProps = {
homepageUrlHref: '/',
containerClassName: 'govuk-width-container',
navigationLabel: 'Navigation menu',
menuButtonLabel: 'Show or hide navigation menu',
navigationLabel: 'Menu',
menuButtonLabel: 'Show or hide menu',
};

export { Header };

0 comments on commit ff9319d

Please sign in to comment.