Skip to content

Commit

Permalink
Apply aria-expanded to the trigger, not the expandable area
Browse files Browse the repository at this point in the history
aria-controls is already set
  • Loading branch information
colinbm committed Jun 21, 2021
1 parent 209d85a commit 5b51590
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/assets/javascripts/_modules/collapsible-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@
function toggleHeading ($topLevelItem) {
var isOpen = $topLevelItem.hasClass('is-open')
var $heading = $topLevelItem.find('> a')
var $body = $topLevelItem.find('.collapsible__body')
var $button = $topLevelItem.find('.collapsible__toggle')
var $toggleLabel = $topLevelItem.find('.collapsible__toggle-label')

$topLevelItem.toggleClass('is-open', !isOpen)
$body.attr('aria-expanded', isOpen ? 'false' : 'true')
$button.attr('aria-expanded', isOpen ? 'false' : 'true')
$toggleLabel.text(isOpen ? 'Expand ' + $heading.text() : 'Collapse ' + $heading.text())
}

Expand Down

0 comments on commit 5b51590

Please sign in to comment.