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

In Edit mode, hyperlinks can direct the user away from the page #48432

Open
sabernhardt opened this issue Feb 24, 2023 · 4 comments
Open

In Edit mode, hyperlinks can direct the user away from the page #48432

sabernhardt opened this issue Feb 24, 2023 · 4 comments
Labels
[Block] Categories Affects the Categories Block Needs Decision Needs a decision to be actionable or relevant [Type] Enhancement A suggestion for improvement.

Comments

@sabernhardt
Copy link
Contributor

Description

@ajaxStardust originally reported this on Trac, using a "Description List" block (from a plugin).

At least with the standard Categories List block, clicking on a link can direct outside the editor when in Edit mode.

I found two ways the editor already prevents opening links in certain blocks. Blocks such as Archives, Calendar and Latest Comments disable clicking or selecting any of their contents. The Latest Posts block allows right-click (Ctrl+click), but clicking on one of the links gives a "Links are disabled in the editor" snackbar message. For the Categories List block, I think the right-click could be valuable.

(Clicking a link inside a Paragraph, Pullquote or Button block opens the link editor instead.)

Step-by-step reproduction instructions

  1. Open the post editor and make sure you are in Edit mode.
  2. Create a Categories List block or another that contains links.
  3. Try to click a link in that block.

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress trunk (6.2-beta3-55400-src), no plugins
  • Firefox 110.0, Windows 10 Home

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@talldan
Copy link
Contributor

talldan commented Feb 28, 2023

I think the same issue with categories was reported in #31169. Most core blocks don't have clickable links by design, but this one has been a longstanding issue.

@kathrynwp kathrynwp added [Type] Enhancement A suggestion for improvement. [Block] Categories Affects the Categories Block Needs Decision Needs a decision to be actionable or relevant labels Feb 28, 2023
@t-hamano
Copy link
Contributor

t-hamano commented Mar 5, 2023

I think the issue with the Latest Posts block reported in #31169 was fixed in #40593.

How about creating a reusable hook as suggested in this comment and applying it to the Category List block as well?

@talldan
Copy link
Contributor

talldan commented Mar 7, 2023

I think the issue with the Latest Posts block reported in #31169 was fixed in #40593.

Sorry, I should've linked to the issue comment - #31169 (comment).

@ajaxStardust
Copy link

ajaxStardust commented Mar 16, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Categories Affects the Categories Block Needs Decision Needs a decision to be actionable or relevant [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

5 participants