Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update accordion.js, closes #444 #574

Merged
merged 1 commit into from
Jul 10, 2024
Merged

Update accordion.js, closes #444 #574

merged 1 commit into from
Jul 10, 2024

Conversation

underdarknl
Copy link
Contributor

These changes should close #444 for pages that by accident mess up their accordion code

@underdarknl underdarknl requested a review from a team as a code owner July 8, 2024 19:10
Copy link

sonarqubecloud bot commented Jul 8, 2024

@reinschaap
Copy link
Contributor

nice nice

@@ -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") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this break the use case of explicitly setting aria-expanded="false" on the first button in the markup to stop it from being expanded by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should not, and is more explicit, only an element with aria-expanded="true" should now be opened on page load.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR: #636

manon/accordion.js Show resolved Hide resolved
@annejan annejan merged commit d5abf55 into main Jul 10, 2024
10 checks passed
@annejan annejan deleted the fix/accordion-hardening branch July 10, 2024 20:22
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Harden accordion Javascript against accordions that have no buttons
5 participants