Skip to content

Commit

Permalink
Merge branch 'feature/PASE-2049' of github.com:penske-media-corp/pmc-…
Browse files Browse the repository at this point in the history
…larva into feature/PASE-2049
  • Loading branch information
marcagarcia committed Feb 4, 2025
2 parents 2baae2e + e8fdeb2 commit 3f3271d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
19 changes: 11 additions & 8 deletions packages/larva-js/src/interface/MegaMenu/MegaMenu.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// no-global-active-element not needed for non-React context.
// https://wordpress.stackexchange.com/a/387511
/* eslint-disable @wordpress/no-global-active-element */

export default class MegaMenu {
constructor( el ) {
this.el = el;
Expand Down Expand Up @@ -63,15 +67,14 @@ export default class MegaMenu {
lastFocusableElement.focus();
event.preventDefault();
}
} else {

// tab key
if (
document.activeElement === lastFocusableElement &&
firstFocusableElement
) {
firstFocusableElement.focus();
event.preventDefault();
}
} else if (
document.activeElement === lastFocusableElement &&
firstFocusableElement
) {
firstFocusableElement.focus();
event.preventDefault();
}
};

Expand Down
4 changes: 4 additions & 0 deletions packages/larva-js/src/interface/MegaMenu/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// no-global-active-element not needed for non-React context.
// https://wordpress.stackexchange.com/a/387511
/* eslint-disable @wordpress/no-global-active-element */

import MegaMenu from './MegaMenu.js';

export default function initMegaMenu() {
Expand Down

0 comments on commit 3f3271d

Please sign in to comment.