-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Don't use target="_blank"
unless needed
#25730
Conversation
Size Change: -13 B (0%) Total Size: 1.2 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks 👍
Hmm. I suppose this does allow us to not have that heavy "open in new tab" icon, right? But I wonder — in some of these cases, the open externally feels like it is there so as to not interfere with the document being edited. If you have unsaved changes and click one of these links it'll prompt you. Which maybe is fine? |
Yeah, I don't see what the problem with that would be... In general I feel we should find a better way to handle content links inside the editor, but that is a bigger topic not related to this PR. |
I'm a bit torn on this one too, but I feel the goal is to achieve better wysiwyg behavior, no? If you do that now, it will open a new tab that will interrupt you in some way too and is inconsistent with front-end that opens in same tab. |
Oh I see, this is for content. For some reason I was thinking of these: This seems okay to me as a trivial step, though I think there's a larger discussion to be had about whether those links should be clickable at all. Inside a reusable block, links are not clickable: And even normal hyperlinks aren't clickable — they open a popover, sure, but aren't directly clickable: An argument could be made that either links inside query blocks such as Latest Posts should be be visual only and blocked entirely just like inside a reusable block. Or, especially if aspects of these links need be configured, they open a popover just like normal hyperlinks. Finally there's "Browse mode", which I picture being a 3rd tool in the tools dropdown. This tool lets you click any link and navigate to its editable counterpart inside the editor. For example if you click the "About" link in a navigation menu, you go and edit that page. |
@jasmussen ah you're right, the categories one was what you posted above. |
We have
target="_blank"
added to read-more buttons, category links, and also as the default on post-titles. These are internal links to the site and should not open in a new tab, it's not what the visitor would expect.This also ties in a11y - see https://www.w3.org/TR/WCAG20-TECHS/G200.html
Useful article:
When to use target="_blank"
Types of changes
Remove
target="_blank" rel="noreferrer noopener"
from categories, post-titles, latest-posts.Checklist: