Skip to content

Commit

Permalink
Clarify that focus trap only applies to overlay, but not submenus.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixarntz committed Feb 11, 2025
1 parent 99f032e commit d15daed
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/block-library/src/navigation/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ const { state, actions } = store(
document.documentElement.classList.add(
'has-modal-open'
);
// Set context for focus trap in the popover for the overlay.
const focusableElements =
ref.querySelectorAll( focusableSelectors );
ctx.firstFocusableElement = focusableElements[ 0 ];
ctx.lastFocusableElement =
focusableElements[ focusableElements.length - 1 ];
}
// Ensure focus is trapped in the popover.
const focusableElements =
ref.querySelectorAll( focusableSelectors );
ctx.firstFocusableElement = focusableElements[ 0 ];
ctx.lastFocusableElement =
focusableElements[ focusableElements.length - 1 ];
} else {
// Ensure state is up to date.
if ( state.isMenuOpen ) {
Expand Down

0 comments on commit d15daed

Please sign in to comment.