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

Block Editor: Link Control: Use URL as link when title empty #19739

Merged
merged 1 commit into from
Jan 20, 2020

Conversation

aduth
Copy link
Member

@aduth aduth commented Jan 17, 2020

Unblocks #19735
Unblocks #19651 (#19651 (comment))
Cherry-picks from #19462 (see remarks)

This pull request seeks to improve the display of <LinkControl /> when a title is not set for the value by using the URL as the rendered external link when the title is unset.

Before After
Before After

Testing Instructions:

In the Buttons and/or Navigation Link blocks, verify that when editing a link, the rendered result shows the title, if assigned, or otherwise the display-formatted URL:

  1. Navigate to Posts > Add New
  2. Insert a Navigation block
  3. Click "Create empty" to start blank
  4. Add a Navigation Link with URL
  5. Verify that the link or title is shown as the external link
    • Note: Even when using a manually-entered URL, the raw URL will be used as a title. This is not an ideal implementation and should be changed in the future.
  6. In "SEO Settings" in the sidebar, clear the "Title attribute" value
  7. Note that the external link shown now reflects the URL

@aduth aduth added [Type] Bug An existing feature does not function as intended [Package] Block editor /packages/block-editor labels Jan 17, 2020
Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

We may also land the "submit button" as well. It's weird that you can't resubmit the link when you edit it.

@aduth
Copy link
Member Author

aduth commented Jan 20, 2020

We may also land the "submit button" as well. It's weird that you can't resubmit the link when you edit it.

Yeah, I see this heavily tied to #19651 in that the behavior of the empty title was the main blocker remaining there. We should be able to merge the other after this.

@aduth aduth merged commit 49cd963 into master Jan 20, 2020
@aduth aduth deleted the update/link-control-empty-title branch January 20, 2020 15:51
@epiqueras epiqueras added this to the Gutenberg 7.4 milestone Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Block editor /packages/block-editor [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants