Skip to content

Commit

Permalink
Update accordion.js, closes #444 (#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
underdarknl authored Jul 10, 2024
1 parent 583f80e commit d5abf55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions manon/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function initAccordion(accordion) {
}

// Set up the initial `aria-expanded` state.
if (button.getAttribute("aria-expanded")) {
if (button.getAttribute("aria-expanded") === "true") {
hasAriaExpandedMarkup = true;
} else {
button.setAttribute("aria-expanded", "false");
Expand All @@ -62,7 +62,7 @@ function initAccordion(accordion) {
}

// Expand the first item by default
if (!hasAriaExpandedMarkup) {
if (!hasAriaExpandedMarkup && buttons.length) {
buttons[0].setAttribute("aria-expanded", "true");
}
}
Expand Down

0 comments on commit d5abf55

Please sign in to comment.