Skip to content

Commit 07469e1

Browse files
authored
Merge pull request #247 from wpaccessibility/fix-aria-expanded
If an active list item contains a button, mark aria-expanded.
2 parents a8ff2c0 + f640d84 commit 07469e1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

assets/js/wp-a11y-docs.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,10 @@
528528
if (target) {
529529
target.classList.add('active');
530530
target.classList.toggle('active', true);
531+
let button = target.querySelector( 'button' );
532+
if ( button ) {
533+
button.ariaExpanded = 'true';
534+
}
531535
target = target.parentNode;
532536
}
533537
}

0 commit comments

Comments
 (0)