-
-
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
Improved removing content after a link element #7668
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the UX and it looks nice.
The implementation is crazy :P but AFAIR it has been discussed with @Reinmar so I'm cool with it.
* {@link module:typing/twostepcaretmovement~TwoStepCaretMovement} plugin is activated and | ||
* the selection is inside the link, at the end, the `linkHref` attribute should stay untouched. | ||
* | ||
* The purpose of this action is to allow removing the link label and keep the selection outside the link. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH I don't understand the "link label" here. WDYM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant a text that described the URL <a href="url">link label</a>
.
@ckeditor/qa-team Can you tak a look at this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides @oleq 's comments I'd change the method name - so cosmetics only. The refactoring done here is nice :)
From the UX perspective I think that we could handle the same way del. I've tested it by setting hasBackspacePressed = true
and it worked as expected. In other words the code for handling hasBackspacePressed
could be removed to handle both delete directions.
Looks ok 👍 |
@jodator, if I remove <paragraph>Foo <$text linkHref="url">Bar</$text>[ ]</paragraph> link attributes will be removed from the selection as well. Are we fine with that? |
AFAICS it would behave the same way as backspace so it is OK for me. If you see that we can squeeze that change with del quickly then I'd do that. If not it's fine to make that a follow up (#7521 (comment)). |
…y as well." This reverts commit 7ddf430.
Suggested merge commit message (convention)
Fix (link): When removing the content after a link element, the selection will not preserve the
linkHref
attribute (and decorators if specified). However, if the selection is placed in the link element (in the middle or at the end), those attributes will be preserved. Closes #7521.