Skip to content

Commit b3a559a

Browse files
authored
Merge pull request #119 from companieshouse/update-aria-describedby
Add fix for aria-describedby not being linked to another element
2 parents 9e1a2f4 + 0efb97b commit b3a559a

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

templates/company/view_all/view.html.tx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
% cascade base { title=> $company.company_name ~" - More (free company information from Companies House)", classes=>"profile" }
22

33
% around content -> {
4-
54
% if $show_snapshot {
65
% include '/includes/company/page_header.tx'
76

7+
% if $show_snapshot && $show_orders {
8+
<p class="hidden" id="described-by">Get company snapshot and ordering service</p>
9+
% } else {
10+
<p class="hidden" id="described-by">Get company snapshot</p>
11+
% }
12+
813
% include '/includes/company/tabs.tx' { active => 'more-tab' };
914
<h2 id="company-snapshot-header" class="heading-large">
1015
Company snapshot <%$company_type%>

templates/includes/company/tab.tx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
%# $page - the URL relative to /company/{company_number} that this tab links to
55
%# $title - the title heading of the tab (may contain HTML)
66
%# $company - the company details needed for display (uses company.company_number)
7-
%# $screenReaderText - the descriptive text read to a screen reader user
7+
%# $describedBy - the descriptive text read to a screen reader user
88

99
<li <% ($active == $tabid ? 'class="active"' : '') | raw %> >
1010

1111
% if ( $active == $tabid ) { "<h1>" | raw }
12-
<a id="<% $tabid %>" aria-describedby="<% $screenReaderText %>" href="<% $c.url_for('/company/' ~ $company.company_number ~ $page) %>"><% $title|raw %><span class="visuallyhidden"> for <% $company.company_name %> (<% $company.company_number %>)</span></a>
12+
<a id="<% $tabid %>" aria-describedby="<% $describedBy %>" href="<% $c.url_for('/company/' ~ $company.company_number ~ $page) %>"><% $title|raw %><span class="visuallyhidden"> for <% $company.company_name %> (<% $company.company_number %>)</span></a>
1313
% if ( $active == $tabid ) { "</h1>" | raw }
1414

1515
</li>

templates/includes/company/tabs.tx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
% if $c.config.feature.company_report {
2525
% if $company.type != "assurance-company" && $company.type != "industrial-and-provident-society" && $company.type != "royal-charter" && $company.type != "investment-company-with-variable-capital" && $company.type != "charitable-incorporated-organisation" && $company.type != "scottish-charitable-incorporated-organisation" && $company.type != "uk-establishment" && $company.type != "registered-society-non-jurisdictional" && $company.type != "protected-cell-company" && $company.type != "eeig" && $company.type != "protected-cell-company" && $company.type != "further-education-or-sixth-form-college-corporation" && $company.type != "icvc-securities" && $company.type != "icvc-warrant" && $company.type != "icvc-umbrella" {
26-
% include "/includes/company/tab.tx" { tabid => 'more-tab', page => '/more', title => 'More', screenReaderText => 'Get company snapshot and ordering services'};
26+
% include "/includes/company/tab.tx" { tabid => 'more-tab', page => '/more', title => 'More', describedBy => 'described-by'};
2727
% }
2828
% }
2929
</ul>

0 commit comments

Comments
 (0)