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

[Chrome/Safari] The selection moves to the beginning of the editor after collapsing it in read only mode #4199

Closed
Mgsy opened this issue Oct 18, 2017 · 3 comments · Fixed by ckeditor/ckeditor5-engine#1814
Labels
browser:chrome browser:safari package:engine type:bug This issue reports a buggy (incorrect) behavior.

Comments

@Mgsy
Copy link
Member

Mgsy commented Oct 18, 2017

Steps to reproduce

  1. Create the Header 1 and the paragraph.
  2. Enter read only mode.
  3. Select part of the paragraph.
  4. Click on the selection to collapse it.

Current result

The selection moves to the beginning of the editor (you can see that dropdown points to the Header 1).

GIF

bug_cke5

Other information

OS: Windows 10, MacOS X
Browser: Chrome, Safari, Opera
Release: 1.0.0-Alpha1

@Reinmar
Copy link
Member

Reinmar commented Sep 2, 2019

IMO, this is "fine" or at least – not harmful :) Unless we see how this could cause any problems to anyone.

@Reinmar Reinmar closed this as completed Sep 2, 2019
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-engine Oct 9, 2019
@mlewand mlewand added browser:chrome browser:safari module:selection resolution:wontfix This issue will not be fixed because the team decided that for given reasons it does not make sense. type:bug This issue reports a buggy (incorrect) behavior. package:engine labels Oct 9, 2019
@scofalik scofalik reopened this Jan 16, 2020
@scofalik
Copy link
Contributor

This incorrect behavior is causing bugs in comments in read-only mode.

@scofalik
Copy link
Contributor

Sorry, I didn't read the issue just looked at the gif :D.

The problem, in overall, is caused by the fact that in the read only mode, the selection is always converted, no matter if it ends up in the editable or outside or is removed at all (like in the case above). This is caused by an incorrect condition in selection observer.

So, when the incorrect DOM selection is mapped to view, there are no ranges in the view that can be mapped with DOM selection ranges. So an empty view selection is upcasted, which causes the bug.

@Reinmar Reinmar removed the resolution:wontfix This issue will not be fixed because the team decided that for given reasons it does not make sense. label Jan 21, 2020
@Reinmar Reinmar added this to the backlog milestone Jan 21, 2020
Reinmar added a commit to ckeditor/ckeditor5-engine that referenced this issue Feb 4, 2020
Fix: DOM selection change will not be converted if the selection was placed outside of the editable element. Closes ckeditor/ckeditor5#4199.
@Reinmar Reinmar modified the milestones: backlog, iteration 29 Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser:chrome browser:safari package:engine type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
4 participants