Skip to content

Navigation Link: Add "Open in new tab" toggle to navigation block sidebar #67262

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

@Infinite-Null Infinite-Null commented Nov 25, 2024

Fixes: #67246

What?

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

Why?

Currently, the "Open in new tab" setting is only available within the link modal of the context menu, while all other link options are presented in the block settings sidebar. This inconsistent placement has confused editors trying to locate this commonly used option.

Screenshots or screencast

After Patch (2)

Copy link

github-actions bot commented Nov 25, 2024

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>
Co-authored-by: relic-se <ogrecooper@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>

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

@carolinan carolinan added the Needs Design Feedback Needs general design feedback. label Nov 25, 2024
@t-hamano t-hamano added [Block] Navigation Link Affects the Navigation Link Block [Type] Enhancement A suggestion for improvement. labels Nov 25, 2024
@relic-se
Copy link

Thanks for getting on top of this, @Infinite-Null ! My only suggestion is that I feel the ToggleControl should be placed underneath "Link" rather than at the top of the Navigation Link block settings.

@Infinite-Null
Copy link
Contributor Author

Thanks for getting on top of this, @Infinite-Null ! My only suggestion is that I feel the ToggleControl should be placed underneath "Link" rather than at the top of the Navigation Link block settings.

Hi @relic-se,

Thank you for the valuable suggestion! is this correct?
image

@relic-se
Copy link

Yes, that looks great. I think you've provided a quick, simple solution for this problem. All clear with me!

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.

Sorry for the late reply.

The code looks good, let's wait for design feedback.

image

@t-hamano t-hamano requested a review from a team June 24, 2025 08:15
@jasmussen
Copy link
Contributor

Should it be a simple checkbox to match what's inside the link dialog?
Screenshot 2025-06-30 at 10 44 05

It doesn't seem valuable to have two different designs for this. Thanks for the PR!

@Infinite-Null
Copy link
Contributor Author

Hi @jasmussen,
Thanks for the feedback 🙌! I’ve updated the PR to use a simple checkbox to match what’s inside the link dialog, ensuring consistency in design. Please review it at your convenience.

Screenshot:

Untitled design

@jasmussen
Copy link
Contributor

Nice quick action. I'd omit the help text, though, the checkbox itself seems plenty descriptive, and by removing the help text you further ensure it's the same design.

@Infinite-Null
Copy link
Contributor Author

Thanks for the feedback @jasmussen,
I have updated the PR and removed the help text:
image

@jasmussen
Copy link
Contributor

Nice, works for me. I'll defer to others on the details. 👍 👍

@t-hamano t-hamano merged commit 74d4dc2 into WordPress:trunk Jun 30, 2025
60 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.2 milestone Jun 30, 2025
@getdave
Copy link
Contributor

getdave commented Jul 11, 2025

We should probably apply the same to the Submenu block

Copy link
Contributor

@priethor priethor left a comment

Choose a reason for hiding this comment

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

We should probably apply the same to the Submenu block

We should check the interface of the Button block, as adding a link there is very different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Link Affects the Navigation Link Block Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Navigation Link Block: Open in new tab
7 participants