Skip to content

Commit

Permalink
Set the initial aria-expanded state on the trigger not the target
Browse files Browse the repository at this point in the history
  • Loading branch information
colinbm committed Jun 28, 2021
1 parent 4ba92c8 commit f46aee7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/assets/javascripts/_modules/collapsible-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@
arrayOfIds.push(uniqueId)
$(this).addClass('collapsible__body')
.attr('id', uniqueId)
.attr('aria-expanded', 'false')
})
$heading.addClass('collapsible__heading')
.after('<button class="collapsible__toggle" aria-controls="' + arrayOfIds.join(' ') + '"><span class="collapsible__toggle-label">Expand ' + $heading.text() + '</span><span class="collapsible__toggle-icon" aria-hidden="true"></button>')
.after('<button class="collapsible__toggle" aria-expanded="false" aria-controls="' + arrayOfIds.join(' ') + '"><span class="collapsible__toggle-label">Expand ' + $heading.text() + '</span><span class="collapsible__toggle-icon" aria-hidden="true"></button>')
$topLevelItem.on('click', '.collapsible__toggle', function (e) {
e.preventDefault()
var $parent = $(this).parent()
Expand Down

0 comments on commit f46aee7

Please sign in to comment.