Skip to content

Commit 3277370

Browse files
committed
Fix accessibility and preserve aligned headings
- Commit 72c2519 improved the alignment between the 'Optional plan components' and 'Select phase to download' headings. However, the change from <legend> to an unreferenced label_tag() hurt the accessibility. - This change puts back the <legend> tag and uses class: 'col-form-label' for both of the aforementioned headings to maintain stylistic consistency between the two elements. - `.col-form-label` overrides <legend> styling to maintain consistent alignment with <label> elements. - Accessibility snapshot of <fieldset> before this fix: Name: "" aria-labelledby: Not specified aria-label: Not specified From legend: Not specified title: Not specified Role: group Invalid user entry: false - Accessibility snapshot of <fieldset> after this fix: Name: "Optional Plan Components" aria-labelledby: Not specified aria-label: Not specified From legend: legend.col-form-label "Optional Plan Components" title: Not specified Role: group Invalid user entry: false Labeled by: legend.col-form-label
1 parent e6810fe commit 3277370

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/views/plans/_download_form.html.erb

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<div class="row">
1919
<div class="form-control col-sm-12 col-lg-6">
2020
<fieldset>
21-
<%= label_tag('', _("Optional plan components"), class: 'form-label') %>
21+
<legend class="col-form-label"><%= _("Optional plan components") %></legend>
2222
<div class="form-check">
2323
<%= label_tag 'export[project_details]', class:'form-check-label' do %>
2424
<%= check_box_tag 'export[project_details]', true, download_coversheet_tickbox_checked %>
@@ -58,7 +58,7 @@
5858
<%= hidden_field_tag 'export[form]', true %>
5959
<% if @phase_options.length > 1 %>
6060
<div class="form-control col-sm-12 col-lg-6">
61-
<%= label_tag(:phase_id, _("Select phase to download"), class: 'form-label') %>
61+
<%= label_tag(:phase_id, _("Select phase to download"), class: 'col-form-label') %>
6262
<%= select_tag(:phase_id, options_for_select(@phase_options, @phase_options[0]), class: 'form-select') %>
6363
</div>
6464
<% else %>

0 commit comments

Comments
 (0)