Skip to content

Remove link by deleting value of URL #25414

Closed

Description

@mrfoxtalbot

Describe the bug
When trying to remove a link, emptying the placeholder/value of the URL in the link should work.

To reproduce
Steps to reproduce the behavior:

  1. Edit an existing link, aiming to remove the link
  2. Empty the value of the URL in the link, and try to "submit" this change

Expected behavior
The editor will prompt the user to add a "Please fill in this field". I would expect that submitting an empty value on a link would remove the link.

Screenshots
cannot-remmove-link-by-editing-URL-3

Editor version (please complete the following information):

  • WordPress 5.5.1
  • The described behaviour happens both with and without the plugin installed (v 9.0.0)

Desktop (please complete the following information):

  • OS: MacOs High Sierra 10.13.6
  • Google Chrome 85.0.4183.102

Additional context
I have found several people struggling to remove a link, expecting that removing the URL would just remove the link.

Activity

  1. added
    [Feature] Link Editing
    [Feature] Rich Text
    [Type] Enhancement
    on Sep 17, 2020
  2. mrfoxtalbot commented on Sep 20, 2020

    @mrfoxtalbot
    Author

    Thank you for labelling this, @youknowriad.

    Just to add context on this issue, and why I believe it is more than just an enhancement, if the block being edited is at the very bottom of the viewport (which can be a fairly common scenario) the block toolbar will be obscured by the URL box, making it effectively impossible for the user to remove the link:

    removelinkbottomviewport

  3. mrfoxtalbot commented on Sep 20, 2020

    @mrfoxtalbot
    Author

    I realize that, given the additional context, it might be a good idea to rename the issue.

  4. ntsekouras commented on Sep 23, 2020

    @ntsekouras
    Contributor

    Related: #18866

  5. bobbingwide commented on Dec 19, 2020

    @bobbingwide
    Contributor

    I recently experienced a similar problem to this when I'd selected the whole of a paragraph to be the link.
    Clicking anywhere in the paragraph block displayed the dialog which obscured most of the toolbar.
    image

    There were a couple of ways around the problem.

    1. Use Top toolbar.
    2. Scroll the paragraph using a mouse so that the toolbar stops at the top and the link popup moves to the end of the link.
      image
  6. added
    [Type] Task
    and removed
    [Type] Enhancement
    on Jul 14, 2021
  7. getdave commented on Sep 23, 2021

    @getdave
    Contributor

    This issue is now largely solved by the Unlink button that's been added to the Link UI itself.

    The trouble with allowing a user to delete and then submit "empty" to remove is that it's ambigious. In most cases we don't want the user to submit empty content as that could create an empty link. Indeed I'm working on a fix right now that disables such behaviour.

    @mrfoxtalbot Would you say this is a big issue now the Unlink button exists? If so please do go ahead and close this out.

  8. mrfoxtalbot commented on Sep 24, 2021

    @mrfoxtalbot
    Author

    Thank you @getdave! Yes, I think that the new "Unlink" button pretty much solves this. I am closing this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Link Editing[Feature] Rich Text[Type] Task

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions