Skip to content

Blocks that link: Provide a split label/URL control and placeholder state #30170

@jasmussen

Description

@jasmussen

What problem does this address?

Splitting this one out from, and basing the design on #28440.

When you insert a link block such as a Menu Item or a Button (to a lesser extent, a Social Link), for the block to be functional it needs to have both a URL and a label configured. At the moment, this happens in a single link dialog interface.

If you type arbitrary text, you are meant to be searching for a page or post that you can choose from the dropdown, or create a draft with that title. For example if you type "WordPress", if you just press Enter, you will create a menu item labelled "WordPress" which links to WordPress:

title alt

But if you use the arrow keys to highlight an existing page, the input field will become the label, and the selected item will become the URL.

title

If you just paste a hyperlink and press Enter, you get a link item that correctly links to that hyperlink, and with a label that's an "educated guess" based on the URL, but still not a good label:

link

In other words, the same input field is used to provide both a label and a link destination, but it's not consistent which one you get. This is causing a number of headaches:

What is your proposed solution?

Keep button blocks, menu items, social links in their placeholder states until both a URL and a link has been added, and split the link dialog to enable it.

These designs are courtesy of @shaunandrews from #28440 (comment):

Adding a Link

Empty.Link.i1.mp4

Adding a Page Link

Empty.Page.Link.i2.mp4

See also:

#29505
#30116

Metadata

Metadata

Assignees

Labels

[Block] NavigationAffects the Navigation Block[Block] Navigation LinkAffects the Navigation Link Block[Feature] Link EditingLink components (LinkControl, URLInput) and integrations (RichText link formatting)[Status] In ProgressTracking issues with work in progress

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions