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

Three issues when trying to edit links #14461

Closed
mapk opened this issue Mar 15, 2019 · 8 comments
Closed

Three issues when trying to edit links #14461

mapk opened this issue Mar 15, 2019 · 8 comments
Labels
[Type] Bug An existing feature does not function as intended

Comments

@mapk
Copy link
Contributor

mapk commented Mar 15, 2019

Describe the bug
I was trying to edit a link's text and ran across 3 different issues.

  1. I can't select just a single word and edit it within the link.
  2. Clicking outside the link and then arrowing over to select the word I want to change causes a series of link popover spasms. The popover keeps disappearing and reappearing with every key stroke.
  3. When I do edit a single word in the link, the link doesn't stay associated to the new word and actually breaks the link into two different groups of linked words.

links

To Reproduce
Steps to reproduce the behavior:

  1. Write a sentence.
  2. Make several words into a link.
  3. Try to edit one of the middle words within the link.

Expected behavior

  1. I expected to be able to select a single word within the group of linked words. I'm able to do this with groups of bold or italicized words.
  2. The popover should just remain open despite my keystroke movements if I'm within the group of linked words.
  3. Editing a word should retain the link associated to the group.

Desktop (please complete the following information):

  • OS: OSX
  • Browser Firefox 65.0.1
  • Gutenberg 5.2
@mapk mapk added the [Type] Bug An existing feature does not function as intended label Mar 15, 2019
@youknowriad
Copy link
Contributor

cc @ellatrix

@ellatrix
Copy link
Member

@mapk I cannot reproduce (1) and (2):

link

@ellatrix
Copy link
Member

Oh, I can reproduce (1) now in Firefox. But still not (3).

@ellatrix
Copy link
Member

For (1), in Firefox, it seems that this is an issue across different contenteditable-based editors. I have the same issue in TinyMCE. Unfortunately, there's no easy fix. The browser sets the selection after a double click, not us. Trying to recreate selecting a word after a double click is hard because word boundaries are different depending on your script. I would suggest not trying to fix this browser bug.

(2) I'll fix.

(3) I'm still trying to reproduce.

@ellatrix
Copy link
Member

Try to select a word in the link here: https://codepen.io/anon/pen/moaeQL. This proves it's a contenteditable bug in Firefox. :)

@ellatrix
Copy link
Member

I checked out 5.2.0 and I can now reproduce (3). It's fixed in master though, I'm not sure which commit exactly fixed it.

@mapk
Copy link
Contributor Author

mapk commented Mar 23, 2019

Thanks for looking into this, @ellatrix!

  1. It's a problem with FF, and not the editor.
  2. You're working on it.
  3. Fixed after 5.2 in master, excellent.

So looks like if 2 can be worked out in a PR, we can close this then. I appreciate your help.

@ellatrix
Copy link
Member

@mapk (2) has been fixed by @aduth in #14938. Would you be able to create an issue just for the Firefox problem? Then we can close this issue as it has mostly been fixed. Unsure if there's a good fix for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants