Skip to content

Commit

Permalink
Provide unique aria labels for attachment edit and removal links
Browse files Browse the repository at this point in the history
This allows each link to be distinguished by individuals using screen readers to navigate quickly through all of the links on the page, which is a minimal accessibility standard according to WCAG 2.1 guidelines.
  • Loading branch information
ryanb-gds committed Dec 4, 2023
1 parent 434f218 commit 4055adf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/views/admin/attachments/_attachments.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
<% end %>
</div>
<div class="app-view-edition-resource__actions govuk-grid-column-full govuk-button-group">
<%= link_to("Edit attachment", [:edit, :admin, typecast_for_attachable_routing(attachable), attachment.becomes(Attachment)], class: "govuk-link govuk-link--no-visited-state") %>
<%= link_to("Delete attachment", [:confirm_destroy, :admin, typecast_for_attachable_routing(attachable), attachment.becomes(Attachment)], class: "govuk-link govuk-link--no-visited-state gem-link--destructive") %>
<%= link_to("Edit attachment", [:edit, :admin, typecast_for_attachable_routing(attachable), attachment.becomes(Attachment)], class: "govuk-link govuk-link--no-visited-state", "aria-label": "Edit attachment: #{attachment.title}") %>
<%= link_to("Delete attachment", [:confirm_destroy, :admin, typecast_for_attachable_routing(attachable), attachment.becomes(Attachment)], class: "govuk-link govuk-link--no-visited-state gem-link--destructive", "aria-label": "Delete attachment: #{attachment.title}") %>
</div>
</li>
<% if attachment != attachable.attachments.includes(:attachment_data).last %>
Expand Down

0 comments on commit 4055adf

Please sign in to comment.