Skip to content

Commit

Permalink
Merge pull request #1943 from alphagov/header-label-name
Browse files Browse the repository at this point in the history
Change header menu button label
  • Loading branch information
Vanita Barrett committed Sep 3, 2020
2 parents f56b03d + 01c9c9c commit 5672a08
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ For example:

This was added in [pull request #1905: Set navigation and mobile menu labels of the header component with new options](https://github.com/alphagov/govuk-frontend/pull/1905).

### Fixes

We’ve made fixes to GOV.UK Frontend in the following pull requests:

- [#1943: Change header menu button label](https://github.com/alphagov/govuk-frontend/pull/1943)


## 3.8.1 (Fix release)

### Fixes
Expand Down
4 changes: 2 additions & 2 deletions src/govuk/components/header/header.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ params:
- name: navigationLabel
type: string
required: false
description: Text for the `aria-label` attribute of the navigation. Defaults to "Top Level Navigation".
description: Text for the `aria-label` attribute of the navigation. Defaults to "Navigation menu".
- name: menuButtonLabel
type: string
required: false
description: Text for the `aria-label` attribute of the button that toggles the navigation. Defaults to "Show or hide Top Level Navigation".
description: Text for the `aria-label` attribute of the button that toggles the navigation. Defaults to "Show or hide navigation menu".
- name: containerClasses
type: string
required: false
Expand Down
4 changes: 2 additions & 2 deletions src/govuk/components/header/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
</a>
{% endif %}
{% if params.navigation %}
<button type="button" class="govuk-header__menu-button govuk-js-header-toggle" aria-controls="navigation" aria-label="{{ params.menuButtonLabel | default('Show or hide Top Level Navigation') }}">Menu</button>
<button type="button" class="govuk-header__menu-button govuk-js-header-toggle" aria-controls="navigation" aria-label="{{ params.menuButtonLabel | default('Show or hide navigation menu') }}">Menu</button>
<nav>
<ul id="navigation" class="govuk-header__navigation {{ params.navigationClasses if params.navigationClasses }}" aria-label="{{ params.navigationLabel | default('Top Level Navigation') }}">
<ul id="navigation" class="govuk-header__navigation {{ params.navigationClasses if params.navigationClasses }}" aria-label="{{ params.navigationLabel | default('Navigation menu') }}">
{% for item in params.navigation %}
{% if item.text or item.html %}
<li class="govuk-header__navigation-item{{ ' govuk-header__navigation-item--active' if item.active }}">
Expand Down
4 changes: 2 additions & 2 deletions src/govuk/components/header/template.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ describe('header', () => {
const $component = $('.govuk-header')
const $list = $component.find('ul.govuk-header__navigation')

expect($list.attr('aria-label')).toEqual('Top Level Navigation')
expect($list.attr('aria-label')).toEqual('Navigation menu')
})

it('allows navigation label to be customised', () => {
Expand Down Expand Up @@ -191,7 +191,7 @@ describe('header', () => {

const $button = $('.govuk-header__menu-button')

expect($button.attr('aria-label')).toEqual('Show or hide Top Level Navigation')
expect($button.attr('aria-label')).toEqual('Show or hide navigation menu')
})
it('allows label to be customised', () => {
const $ = render('header', examples['with custom menu button label'])
Expand Down

0 comments on commit 5672a08

Please sign in to comment.