alphagov / frontend

Serves the homepage, transactions and some index pages on GOV.UK
https://docs.publishing.service.gov.uk/apps/frontend.html
MIT License
38 stars 20 forks source link

Skip link not working on About pages #4408

Open MartinJJones opened 2 hours ago

MartinJJones commented 2 hours ago

What

The skip link does not allow you to skip to the main content on the /help pages, with the exception of /help/cookies

The JavaScript error below is thrown in the console:

Error starting GovukSkipLink component JS
ElementError: govuk-skip-link
Target content (`id="content"`) not found

Possible fix

We should be able to fix this by adding <main id="content"> to the _body_with_related_links.html.erb view template, similar to the approach used in _base_page.html.erb

andysellick commented 2 hours ago

Good spot @MartinJJones. I think this might relate to some of recent app consolidation work, going to ping @KludgeKML to check.

KludgeKML commented 2 hours ago

Yes, that's correct - when the help pages got moved over (they were the first set to be moved), we didn't notice that government-frontend pages all had an implicit main element in the layout, but frontend pages all supplied their own main element. I'll write up a card to get this added.

MartinJJones commented 2 hours ago

Thanks @andysellick @KludgeKML 👍