-
-
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
Implement two-step caret movement at styled text boundaries #4269
Comments
I'm having a second thought about this. Without a visual indicator that something happened after your key press it might be confusing why the caret hasn't moved. In the classic or inline editors, the toolbar would act as an indicator, but in the balloon editor or Letters there will be no such thing. Hence, let's maybe limit this behaviour to certain attributes only. Those which cause more troubles – links and perhaps highlight. The problem with the highlight feature is, though, that it's much harder to indicate that you left it. We'd need some tricks with outline perhaps. |
I'm for it. For styles like bold or italic, it might be unexpected. |
For bold or italic I'd go with Firefox'es solution, that is the selection style depends on from which side you reached the styled text. EDIT: But then it might be weird that we have different solutions for different attributes/plugins. |
TBH, I'd leave bold, italic, etc. as they are because one can always remove the selection attribute by pressing the toolbar button/keystroke. I'd bring the new behavior for such features, which don't come with a possibility to clean up the selection without changing the content around (e.g. unlink removes the entire link). |
Yeah, that's the current plan. In fact, we'll focus on the link feature first, since the highlight feature hasn't even landed yet. |
I've created |
You could put it in the link pkg for now. It's going to be used only there for now. But if you already want to predict that highlight will use it, then we should find a place for it here in the engine, I think. |
|
|
Feature: Introduced two-step caret movement mechanism. Closes #1289.
Background: see https://github.com/ckeditor/ckeditor5-link/issues/72.
<b><i>x[]</b></i>x
–><b><i>x</b></i>[]x
(gets out of all styles at once)<b><i>x[]</b>x</i>
–><b><i>x</b>[]x</i>
keydown
(see https://github.com/ckeditor/ckeditor5-link/compare/hackathon-link-end) – selection attributes will be refreshed on nextapplyOperation
which may fail when:DocumentSelection#overrideGravity()
. The gravity should be overridden until the current user changes the selection. More or less. We can also allow defining how long the gravity is overridden by specifying your own callback or returning a function to be called to revert the gravity. Etc.The text was updated successfully, but these errors were encountered: