Skip to content

Commit f640d84

Browse files
committed
If an active list item contains a button, mark aria-expanded.
Fixes #238
1 parent a8ff2c0 commit f640d84

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)