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

Bulk editing in link popover doesn't work #24753

Closed
Tracked by #35073
thijsdevalk opened this issue Aug 24, 2020 · 2 comments
Closed
Tracked by #35073

Bulk editing in link popover doesn't work #24753

thijsdevalk opened this issue Aug 24, 2020 · 2 comments
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting)

Comments

@thijsdevalk
Copy link

Describe the bug
When having a list of links, I can select multiple line-items at the same time, which will show the link popover. So it looks like I can edit all those links in my list at the same time. However, if I, for example, set them to "open in new tab", all the links will suddenly point to the same URL. There is no notification of this happening, the anchor text stays the same, it's just the URLs that change.

To reproduce
Steps to reproduce the behavior:

  1. Go to edit a post or page
  2. Create a list and add links to the list items
  3. Select multiple lines
  4. Click anything in the popover that pops up after selecting
  5. Notice the URLs of the list items now all point to the same URL.

Expected behavior
I was expecting one of two things:

  1. For bulk editing not to be possible, so I can't select multiple links and still have the popover show, or
  2. If bulk editing should be possible, for the URLs of the links I selected to remain what they were.

Screenshots
Screenshot 2020-08-24 at 07 58 55

Editor version (please complete the following information):

  • WordPress version: 5.5
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? default

Desktop (please complete the following information):

  • OS: MacOS 10.15.4
  • Browser: Chrome
  • Version: 84.0.4147.135
@aristath
Copy link
Member

aristath commented Aug 25, 2020

Tested different variations and concepts and I can confirm the above bug happens.
But I'm still not sure it qualifies as a bug because there are 2 ways to look at it...

The fact that it's a list element complicates things, but for the sake of simplicity, we can treat the list as a paragraph block and links separated using a soft linebreak. The behavior is exactly the same, so the list is of no consequence.
When we select multiple list elements, we're basically just selecting text. That becomes clear when we drag-select from the end of the last link to the middle of the first link. If links were separate entities, we wouldn't be able to select half the 1st link, it would be selected in whole... (That is what happens when for example we try and select multiple paragraph elements since they are a separate entity).
So links are treated as inline text properties, just like bold or italics.
With that in mind, if I were to click "bold" I'd expect the text I've selected to become bold. The link popover allows editing the link properties, and it happens to use the properties of the end-point (the last point we clicked/dragged when selecting multiple links) as a reference for the properties it will show/edit.

So what happens is we're basically editing the link for selected text instead of editing the properties for selected links.

Now here's the dilemma: Is a link a separate entity? Or is it part of the normal text flow?
If we consider links as part of the normal text flow, then there is no bulk editing, we're just editing a single selection of text.
If we consider links as separate entities, then they should be a block of their own - which in turn means that lists should allow inner-blocks 🤔

@aristath aristath added the [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) label Aug 25, 2020
@getdave
Copy link
Contributor

getdave commented Nov 14, 2021

I think this has been fixed by #35946 which stops the link from appearing if the current selection extends beyond the boundary of the link format.

@getdave getdave closed this as completed Nov 14, 2021
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)
Projects
None yet
Development

No branches or pull requests

3 participants