Skip to content

Commit

Permalink
Fix usages of aria-labelledby
Browse files Browse the repository at this point in the history
These now conform to the W3C spec.

https://www.w3.org/TR/wai-aria/#region
  • Loading branch information
Ben Thorner committed Mar 26, 2020
1 parent a097b81 commit f9d46f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
10 changes: 5 additions & 5 deletions app/views/content_items/_attachments.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<% attachment_title_id = "#{title.parameterize}-title" %>

<% if legacy_pre_rendered_documents.present? || attachments.any? %>
<%= render 'govuk_publishing_components/components/heading',
id: attachment_title_id,
text: title,
mobile_top_margin: true %>
<div role="region" aria-labelledby="<%= attachment_title_id %>">
<%= render 'govuk_publishing_components/components/heading',
id: attachment_title_id,
text: title,
mobile_top_margin: true %>

<div aria-labelledby="<%= attachment_title_id %>">
<% if legacy_pre_rendered_documents.present? %>
<%= render 'govuk_publishing_components/components/govspeak',
content: legacy_pre_rendered_documents.html_safe,
Expand Down
11 changes: 6 additions & 5 deletions app/views/content_items/publication.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@
legacy_pre_rendered_documents: @content_item.documents,
attachments: @content_item.featured_attachments %>

<%= render 'govuk_publishing_components/components/heading',
text: t("publication.details"),
id: "details-title",
mobile_top_margin: true %>

<div aria-labelledby="details-title">
<div role="region" aria-labelledby="details-title">
<%= render 'govuk_publishing_components/components/heading',
text: t("publication.details"),
id: "details-title",
mobile_top_margin: true %>

<%= render 'govuk_publishing_components/components/govspeak',
content: @content_item.details.html_safe,
direction: page_text_direction %>
Expand Down

0 comments on commit f9d46f6

Please sign in to comment.