Skip to content

Commit fafcf61

Browse files
jcoynecbeer
authored andcommitted
Add aria-expanded attribute to the collapse control
1 parent 544c0ba commit fafcf61

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

app/components/arclight/document_collection_context_component.html.erb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
<div class="documentHeader row" data-document-id="<%= document.id %>">
1212
<% if document.children? %>
1313
<div class="al-toggle-children-container">
14-
<%= link_to(
15-
'',
16-
"##{document.id}-collapsible-hierarchy",
17-
class: "al-toggle-view-children #{!show_expanded?(document) ? 'collapsed' : ''}",
18-
'aria-label': t('arclight.hierarchy.view_all'),
14+
<%= link_to('',
15+
"##{document.id}-collapsible-hierarchy",
16+
class: "al-toggle-view-children#{ ' collapsed' unless show_expanded?(document)}",
17+
aria: {
18+
label: t('arclight.hierarchy.view_all'),
19+
expanded: show_expanded?(document)
20+
},
1921
data: {
2022
toggle: 'collapse'
2123
}

0 commit comments

Comments
 (0)