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

Renderer should not rerender similar non-collapsed selection. #4026

Closed
f1ames opened this issue Mar 23, 2017 · 3 comments · Fixed by ckeditor/ckeditor5-engine#896
Closed
Assignees
Labels
package:engine type:improvement This issue reports a possible enhancement of an existing feature.
Milestone

Comments

@f1ames
Copy link
Contributor

f1ames commented Mar 23, 2017

See https://github.com/ckeditor/ckeditor5-typing/issues/87 for inital discussion.

There are some cases in which selection changes (the start/end position), but visually it is the same. For example:
<p><em>Text{1}</em></p>
and
<p><em>Text1[1</em>]</p>

In such cases, we call it similar selection (basically, it is not the same, but very similar - only start/end container is different but offsets are somehow the same). In those cases the renderer should detect it and do not rerender the selection (because e.g. it breaks composition sometimes - https://github.com/ckeditor/ckeditor5-typing/issues/87).

This applies only to non-collapsed selection for now.

For collapsed selection it may break a few things, e.g. inserting empty <strong></strong> (with Ctrl/Cmd + b). The selection here is fixed and moved inside empty tag. It is a similar selection so it would not be rendered which is an invalid behavior.

@oskarwrobel
Copy link
Contributor

@f1ames
Copy link
Contributor Author

f1ames commented Mar 23, 2017

Seems like #4022 is very similar issue, so it may get fixed.

@f1ames f1ames self-assigned this Mar 23, 2017
@f1ames
Copy link
Contributor Author

f1ames commented Mar 29, 2017

Created a PR ckeditor/ckeditor5-engine#887.

Reinmar referenced this issue in ckeditor/ckeditor5-engine Mar 30, 2017
Fix: Renderer should not change the native selection if the one it's about to render is visually similar to the current one. Closes #887. Closes #880.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-engine Oct 9, 2019
@mlewand mlewand added this to the iteration 9 milestone Oct 9, 2019
@mlewand mlewand added module:selection type:improvement This issue reports a possible enhancement of an existing feature. package:engine labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants