Skip to content

Navigation Submenu Link: Add Open in new tab toggle to navigation block sidebar #70687

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

Merged

Conversation

Infinite-Null
Copy link
Contributor

Follow up of: #67262

What?

Adds the "Open in new tab" toggle option to the Navigation Submenu block's settings sidebar, making it accessible alongside other link settings.

Why?

Users need the ability to configure submenu links to open in new tabs. This setting was missing from the Navigation Submenu Inspector controls, creating an inconsistency with other navigation blocks.

Testing Instructions

  1. Create a Navigation block with submenus
  2. Select a Navigation Submenu block
  3. Verify the "Open in new tab" toggle appears in the Inspector control
  4. Toggle the setting and confirm it saves correctly
  5. Test the link behavior on the frontend

Screencast:

Screen.Recording.2025-07-11.at.1.22.07.PM.mov

Copy link

github-actions bot commented Jul 11, 2025

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: Infinite-Null <ankitkumarshah@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

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

@Infinite-Null
Copy link
Contributor Author

Hi @getdave, I’ve opened a follow-up PR that adds the ‘Open in new tab’ option to the Navigation Submenu Inspector controls for consistency. Please review it at your convenience! Thank you 🙌.

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Block] Submenu Affects the Submenu Block - for submenus in navigation labels Jul 11, 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.

Thanks for the PR!

This PR works correctly just like the Navigation Link block, but I found that the "Reset all" button does not work properly:

6094ae364596854204e3a4e263e150e7

I think we need to update here:

resetAll={ () => {
setAttributes( {
label: '',
url: '',
description: '',
rel: '',
} );
} }

The Navigation Link block will also need to be fixed in a follow-up PR.

@Infinite-Null
Copy link
Contributor Author

Screen.Recording.2025-07-11.at.4.05.16.PM.mov

Hi @t-hamano, Thank you for the feedback 🙌. I have updated the PR and fixed the issue. Please review it at your convenience. Also, will open a follow-up PR with the fix for the same for the Navigation Link block shortly.

@Infinite-Null Infinite-Null requested a review from t-hamano July 11, 2025 16:01
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 👍

@t-hamano t-hamano merged commit 87d0bc1 into WordPress:trunk Jul 12, 2025
61 of 62 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.3 milestone Jul 12, 2025
cbravobernal pushed a commit that referenced this pull request Jul 15, 2025
…lock sidebar (#70687)

* feat: Add 'Open in new tab' option to Navigation Submenu block

* Set default value for opensInNewTab in NavigationSubmenuEdit

Co-authored-by: Infinite-Null <ankitkumarshah@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Submenu Affects the Submenu Block - for submenus in navigation [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants