-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Typing over the link (replacing link text) #4762
Comments
My comments from #852:
What I meant by "after we do ckeditor/ckeditor5-link#73" is that we should somehow force the editor in this case that first letter typed when link is fully selected gets this link's However, I don't know which solution is better for the user – a clear "link text" input or this behaviour. Or maybe both. WDYT, guys? |
As I wrote in ckeditor/ckeditor5-highlight#6 (comment), I don't know why we went this way that typing over fully selected styled text removes the formatting. In CKEditor 4 this works differently for bold and italic, in which case you still type with these styles. With link... it's broken: <p>a b <a href="">[c]</a> d</p>
+ "xxx"
<p>a b <a href="">x</a>xx[] d</p> I think that I'd rather expect the same behaviour as with bold and italic in CKEditor 4. This seems to be more useful for all kinds of styles. Most likely, the current behaviour comes from the fact that on a key press (non-safe key) we completely remove the currently selected content and insertion happens separately. We'd need to somehow store this information in the typing feature and apply it when the first character after deletion is inserted. |
I've checked a few solutions that we have available on the market. Typing over the entire linkThe link is selected from left to right.
Typing in the non collapsed selection in the linkAll editors listed above do the same action: replaces the text and keeps the link. Typing when the selection starts at the beginning of the link (ends in)
Typing when the selection ends at the end of the link (starts somewhere in)
My 5 cents
|
From what I can see, GDocs behave like CKE5 – you write without the link.
So, AFAICS, there's just one behavior that perhaps we should change – the one with typing at the beginning on a non-collapsed selection. We could indeed align our behavior to that of CKE4, Tiny, Quill here. However, my question would be – why? How's this different from typing over the entire link? Why can I edit the beginning of a link or the end of the link but not the entire link text at once? |
For the above behavior I'm not sure TBH, so another voice needed.
The below are 👍 for me:
|
Same thoughts here. I'm also considering being inconsistent with other editors. And I also see a difference between typing over a link and pressing backspace/delete. In the latter case, I think that it's more natural to remove the link. In the former, I think we could risk keeping the link. Let's maybe discuss this tomorrow on the sync too. |
For me, not being able to replace the link text by selecting it and typing over is indeed a PITA. I resort to tricks like "select everything but the first and the last character, type what I want, remove the first and the last character". I'd much prefer "keep the link but replace the link text when typing over; delete the link entirely on backspace". |
Notes from internal meeting:
|
Feature (link): Typing over the selected link will not remove the link itself. Instead, the typed text will replace the link text. Closes #4762.
This was mentioned in #4720 but requires a separate ticket. Because of UX we need to allow replacing link text.
See w3c/editing#156 (comment).
See also – typing after a link: https://github.com/ckeditor/ckeditor5-link/issues/72.
The text was updated successfully, but these errors were encountered: