Skip to content

Commit

Permalink
Add hidden attribute to the header menu button
Browse files Browse the repository at this point in the history
This follows on from the corresponding upstream change[0][1], released
in 4.3.0

[0] alphagov/govuk-frontend#2727
[1] https://github.com/alphagov/govuk-frontend/pull/2727/files#diff-dcc9d461905ec3f2d5c9a73c4c7bc09499b0c8265fe7e32c097b0e6649e1106fL64

Co-authored-by: Frankie Roberto <[email protected]>
  • Loading branch information
peteryates and frankieroberto committed Aug 11, 2022
1 parent 4aaedb5 commit 3eed8de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/components/govuk_component/header_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<% if navigation_items.any? %>
<%= tag.nav(**navigation_html_attributes) do %>
<%= tag.button("Menu", type: "button", class: %w(govuk-header__menu-button govuk-js-header-toggle), aria: { controls: "navigation", label: menu_button_label }) %>
<%= tag.button("Menu", type: "button", class: %w(govuk-header__menu-button govuk-js-header-toggle), hidden: true, aria: { controls: "navigation", label: menu_button_label }) %>
<ul id="navigation" class="govuk-header__navigation-list">
<% navigation_items.each do |item| %>
<%= item %>
Expand Down
2 changes: 1 addition & 1 deletion spec/components/govuk_component/header_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@

specify 'the button is rendered' do
expect(rendered_content).to have_tag('div', with: { class: 'govuk-header__content' }) do
with_tag('button', with: { class: button_classes, 'aria-label' => button_aria_label }, text: button_text)
with_tag('button', with: { class: button_classes, 'aria-label' => button_aria_label, hidden: 'hidden' }, text: button_text)
end
end

Expand Down

0 comments on commit 3eed8de

Please sign in to comment.