Skip to content

Commit

Permalink
Merge pull request #3863 from alphagov/move-the-skip-link-after-the-c…
Browse files Browse the repository at this point in the history
…ookie-banner

Move the skip link after the cookie banner
  • Loading branch information
jon-kirwan authored Feb 6, 2024
2 parents 8e52c13 + 94bdad5 commit b40c3e7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
useful summary for people upgrading their application, not a replication
of the commit log.

## Unreleased

* Move the skip link after the cookie banner ([PR #3863](https://github.com/alphagov/govuk_publishing_components/pull/3863))

## 37.3.0

* Allow other applications to use GA4 code ([PR #3851](https://github.com/alphagov/govuk_publishing_components/pull/3851))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,10 @@
<%= javascript_tag nonce: true do -%>
document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');
<% end -%>
<%= render "govuk_publishing_components/components/cookie_banner", layout_helper.cookie_banner_data %>
<%= render "govuk_publishing_components/components/skip_link", {
href: "#content"
} %>

<%= render "govuk_publishing_components/components/cookie_banner", layout_helper.cookie_banner_data %>

<% unless omit_header %>
<% if show_explore_header %>
<% if homepage %>
Expand Down
6 changes: 6 additions & 0 deletions spec/components/layout_for_public_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,10 @@ def component_name
expect(meta.first["content"]).to match(%r{^https?://})
end
end

it "has the skip link immediately after the cookie banner" do
render_component({})

assert_select ".gem-c-cookie-banner + .gem-c-skip-link"
end
end

0 comments on commit b40c3e7

Please sign in to comment.