File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @10up/component-navigation" ,
3
- "version" : " 2.1.3 " ,
3
+ "version" : " 2.1.4 " ,
4
4
"author" : " 10up" ,
5
5
"description" : " Accessible navigation component." ,
6
6
"main" : " dist/index.js" ,
Original file line number Diff line number Diff line change @@ -296,8 +296,10 @@ export default class Navigation {
296
296
* @param {element } $submenu The submenu to open. Required.
297
297
*/
298
298
openSubmenu ( $submenu ) {
299
+ const $anchor = $submenu . previousElementSibling ;
299
300
// Open the submenu by updating ARIA and class.
300
301
$submenu . setAttribute ( 'aria-hidden' , false ) ;
302
+ $anchor . setAttribute ( 'aria-expanded' , true ) ;
301
303
302
304
/**
303
305
* Called when a submenu item is opened.
@@ -320,6 +322,7 @@ export default class Navigation {
320
322
321
323
// Close the submenu by updating ARIA and class.
322
324
$submenu . setAttribute ( 'aria-hidden' , true ) ;
325
+ $anchor . setAttribute ( 'aria-expanded' , false ) ;
323
326
324
327
if ( $childSubmenus ) {
325
328
// Close any children as well.
You can’t perform that action at this time.
0 commit comments