WordPress/gutenberg

Page jumps away when trying to edit an anchor link

Open

#72,505 创建于 2025年10月20日

在 GitHub 查看
 (13 评论) (0 反应) (1 负责人)JavaScript (9,607 star) (3,893 fork)batch import
Good First Issue[Feature] Link Editing[Status] In Progress[Type] Bug

描述

Description

Anchor links remain active in the Gutenberg editor, which makes them very hard to edit.

When you click an anchor link intending to change its URL, you will lose your position on the page.

Allowing anchors to jump appears to be deliberate but is very confusing and not great when trying to edit.

Step-by-step reproduction instructions

  1. In the Gutenberg editor, add several paragraphs of text, enough to fill up at least the height of the screen. Select some text near the bottom, click the link button, and enter a URL of #.

  2. Later, click on the text, expecting to see the usual popup where you can edit the link.

  3. Note that while the popup is triggered, you won't see it at all; instead you have been scrolled to the very top of the page, and have to scroll all of the way back down to find the link that you were trying to edit.

Screenshots, screen recording, code snippet

No response

Environment info

Tested on a fresh installation of WordPress 6.8.3 and default themes, no Gutenberg plugin

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

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

贡献者指南

Page jumps away when trying to edit an anchor link · WordPress/gutenberg#72505 | Good First Issue