Skip to content

Commit

Permalink
Remove aria-expanded from location accordion
Browse files Browse the repository at this point in the history
aria-expanded is supposed to go on the focusable interactive control that displays the collapsable section, not the collapsable section itself.

See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded
  • Loading branch information
jcoyne committed Mar 8, 2024
1 parent 2b2bdcf commit c395d99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/catalog/_accordion_section_library.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<%= snippet %>
</span>
</div>
<div class="details <%= id %>-location" aria-expanded="false" data-controller="live-lookup" data-live-lookup-url-value="<%= availability_index_path %>">
<div class="details <%= id %>-location" data-controller="live-lookup" data-live-lookup-url-value="<%= availability_index_path %>">
<% if document.holdings.present? %>
<% document.holdings.libraries.select(&:present?).each do |library| %>
<%= render SearchResult::LocationComponent.new(library:, document:) %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
expect(rendered).to have_css('.accordion-section.location')
expect(rendered).to have_css('.accordion-section.location button.header[aria-expanded="false"]', text: "Check availability")
expect(rendered).to have_css('.accordion-section.location span.snippet', text: "Green Library")
expect(rendered).to have_css('.accordion-section .details[aria-expanded="false"]')
expect(rendered).to have_css('.accordion-section .details')
expect(rendered).to have_css('.accordion-section .details tbody tr', count: 2)
expect(rendered).to have_css('.accordion-section .details tbody tr th', text: /Stacks/)
expect(rendered).to have_css('.accordion-section .details tbody tr td', text: /ABC 123/)
Expand Down

0 comments on commit c395d99

Please sign in to comment.