Skip to content

Commit c933a2e

Browse files
authored
Merge pull request #143 from 10up/develop
Release 2.0.4
2 parents 9b40823 + b5bcff9 commit c933a2e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/navigation/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@10up/component-navigation",
3-
"version": "2.1.3",
3+
"version": "2.1.4",
44
"author": "10up",
55
"description": "Accessible navigation component.",
66
"main": "dist/index.js",

packages/navigation/src/navigation.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,10 @@ export default class Navigation {
296296
* @param {element} $submenu The submenu to open. Required.
297297
*/
298298
openSubmenu($submenu) {
299+
const $anchor = $submenu.previousElementSibling;
299300
// Open the submenu by updating ARIA and class.
300301
$submenu.setAttribute('aria-hidden', false);
302+
$anchor.setAttribute('aria-expanded', true);
301303

302304
/**
303305
* Called when a submenu item is opened.
@@ -320,6 +322,7 @@ export default class Navigation {
320322

321323
// Close the submenu by updating ARIA and class.
322324
$submenu.setAttribute('aria-hidden', true);
325+
$anchor.setAttribute('aria-expanded', false);
323326

324327
if ($childSubmenus) {
325328
// Close any children as well.

0 commit comments

Comments
 (0)