Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Focus submenu button when clicked #55198

Merged
merged 12 commits into from
Oct 18, 2023
8 changes: 8 additions & 0 deletions packages/block-library/src/navigation/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ const openMenu = ( store, menuOpenedOn ) => {
// Add a `has-modal-open` class to the <html> root.
document.documentElement.classList.add( 'has-modal-open' );
}
// Focus the clicked button manually because Safari
// doesn't place focus on it.
if (
menuOpenedOn === 'click' &&
context.core.navigation.type === 'submenu'
) {
ref.focus();
}
};

const closeMenu = ( store, menuClosedOn ) => {
Expand Down
Loading