Skip to content

Fix submenu border visibility in Navigation block #70520

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

Conversation

R1shabh-Gupta
Copy link
Contributor

What?

Closes #70516

Fixes the visual clipping of submenus in the Navigation block when a menu item is focused via keyboard. Specifically, it resolves an issue where the bottom part of nested submenus was hidden.

Why?

When using the keyboard to navigate a nested menu (e.g., via the Tab key), the browser displays a focus outline on the menu item. In many default themes (including Emptytheme), the bottom portion of the focused submenu was being clipped, making it inaccessible or visually broken.

How?

Added z-index: 1 to the .wp-block-navigation-item__content class to ensure that submenu containers are correctly layered above surrounding elements, preventing clipping and making the keyboard focus outline fully visible.

Testing Instructions

  1. Open a post or page editor.
  2. Insert a Navigation block.
  3. Add a nested menu structure (at least two levels deep).
  4. Save and preview the page on the front end.
  5. Use the Tab key to navigate into the menu and focus a submenu item.

Testing Instructions for Keyboard

  1. Use Tab key to focus into the top-level menu.

  2. Continue tabbing into the submenu.

  3. Observe that:

    • Focus ring appears correctly.
    • Entire submenu content (including bottom items) remains visible.
    • No parts are visually cut off.

Screenshots or screencast

Emptytheme

Emptytheme

Twenty Twenty-Two

Twenty Twenty-Two

Twenty Twenty-Three

Twenty Twenty-Five

Twenty Twenty-Four

Twenty Twenty-Two

Twenty Twenty-Five

Twenty Twenty-Five

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Jun 25, 2025
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @R1shabh-Gupta! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@R1shabh-Gupta R1shabh-Gupta marked this pull request as ready for review June 25, 2025 09:45
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: R1shabh-Gupta <[email protected]>
Co-authored-by: t-hamano <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Block] Navigation Affects the Navigation Block labels Jun 25, 2025
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I think this is the simplest and best approach.

@t-hamano t-hamano merged commit 1f78151 into WordPress:trunk Jun 26, 2025
68 of 71 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.2 milestone Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Navigation Block: Part of the focus outline is hidden
2 participants