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

Remove link by deleting value of URL #25414

Closed
Tracked by #35073
mrfoxtalbot opened this issue Sep 17, 2020 · 6 comments
Closed
Tracked by #35073

Remove link by deleting value of URL #25414

mrfoxtalbot opened this issue Sep 17, 2020 · 6 comments
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@mrfoxtalbot
Copy link

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.

@youknowriad youknowriad added [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Type] Enhancement A suggestion for improvement. labels Sep 17, 2020
@mrfoxtalbot
Copy link
Author

mrfoxtalbot commented Sep 20, 2020

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

@mrfoxtalbot
Copy link
Author

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

@ntsekouras
Copy link
Contributor

Related: #18866

@bobbingwide
Copy link
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

@mtias mtias added [Type] Task Issues or PRs that have been broken down into an individual action to take and removed [Type] Enhancement A suggestion for improvement. labels Jul 14, 2021
@getdave
Copy link
Contributor

getdave commented Sep 23, 2021

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.

@mrfoxtalbot
Copy link
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
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

No branches or pull requests

6 participants