Skip to content

Navigation Link: Issues with unlinking Page Link from Sidebar (reset of caption, input focus loss) #72481

@ockham

Description

@ockham

Description

When unlinking a Page Link block from the block inspector, a number of strange things happen:

  • The label (in the editor canvas) is reset. See the screenshot: Upon unlinking, the label changes to "Select page". (This is unexpected for me -- I'd expect the label to remain unchanged.)
  • The URL input field is cleared. (It might make sense to keep the previous value and simply make it editable.) More importantly, when you start manually entering a new URL, after pressing one letter, focus is stolen by the block label input in the canvas, and any subsequent keypresses will go there -- see screencast.

@jeryj and I observed these issues while discussing #72165.

Step-by-step reproduction instructions

  1. Go to the Site Editor. Make sure you have a Navigation block with at least one Page Link block.
  2. Open the block inspector for the Page Link block.
  3. Click the "Unlink" button. It will clear the "Link" field. Note that it will also remove the label from the block in the editor canvas (it will fall back to "Select page").
  4. Start typing a new URL. Observe that after you've pressed one letter (e.g. the h in https://), focus will be stolen by the block label input in the canvas, and the rest of the URL you're typing will end up there.

Screenshots, screen recording, code snippet

Image

Environment info

No response

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

Metadata

Metadata

Assignees

Labels

[Block] Navigation LinkAffects the Navigation Link Block[Type] BugAn existing feature does not function as intended

Type

No type
No fields configured for issues without a type.

Projects

Status
✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions