-
-
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
Selection could be outside of the link after pasting #6053
Comments
Actually this issue seems to be related to a yet bigger problem: unexpected auto-linking when pasting urls... but just those copied from the browser address bar (Chrome only?). For example:
We have an inconsistent behavior here. Users may feel that what happens is right but the fact is that CKEditor is having no control of it... and no control is not good. The fact is that the browser itself is saving in the clipboard the url copied from its address bar in both HTML and plain-text format. The HTML version is something like I believe the proper solution here is not auto-linking in such situation and leave the auto-linking feature to be handled by a future feature that will do so in all cases, no matter if copied from the address bar or a plain-text source. |
Tested with Firefox and Safari... these browsers don't put a HTML version in the clipboard so this issue doesn't happen there. |
Related: #1016 (see e.g. use case described in #1016 (comment)) |
I think that this can be fixed by listening on model#insertContent and changing the gravity of the selection to "right" when we detected that a link was pasted. |
OK, we have two separate problems in this issue:
|
Fix: Link selection attributes should be cleared after inserting a link via `Model#insertContent()` for better UX. Closes ckeditor/ckeditor5#6053.
Fix: Link selection attributes should be cleared after inserting a link via `Model#insertContent()` for better UX. Closes #6053.
📝 Provide a description of the improvement
How the feature works now and what you'd like to change?
When pasting a link the selection (cursor) could be moved outside of the link, so after pasting typing won't extend the pasted link. This behavior doesn't exist in CKEditor 4 and other editors.
📃 Other details
If you'd like to see this improvement implemented, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: