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

Images can't be selected inside tables in certain scenarios #1523

Closed
Reinmar opened this issue Feb 12, 2019 · 4 comments
Closed

Images can't be selected inside tables in certain scenarios #1523

Reinmar opened this issue Feb 12, 2019 · 4 comments
Assignees
Labels
type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@Reinmar
Copy link
Member

Reinmar commented Feb 12, 2019

feb-12-2019 15-27-31

@Reinmar Reinmar added type:bug This issue reports a buggy (incorrect) behavior. status:confirmed labels Feb 12, 2019
@Reinmar Reinmar added this to the iteration 22 milestone Feb 12, 2019
@jodator
Copy link
Contributor

jodator commented Feb 12, 2019

@Reinmar to be 100% sure - it's a single image in table cell that cannot be selected, right?

@Reinmar
Copy link
Member Author

Reinmar commented Feb 12, 2019

Yes.

And the problem is that fake selection isn't created at all in those cases. Just like we noticed for inline widgets.

@Reinmar
Copy link
Member Author

Reinmar commented Feb 12, 2019

Another one: #1524

I'm going to review those changes with inline widgets now :D

@Reinmar Reinmar modified the milestones: iteration 22, iteration 23 Feb 13, 2019
@Reinmar
Copy link
Member Author

Reinmar commented Feb 13, 2019

The PRs for inline widgets don't help here. This is a separate issue.

After some more investigation, it turned out that it is reproducible when clicking on an image in a blurred table cell (when the selection is in another cell or outside table). It's not visible when the image is the only/first element of that cell because then it gets automatically selected when the browser tries to make a collapsed selection at the beginning of that cell.

This issue can be caused by the order in which we render things. I guess that it may look like this:

  1. the user clicks on an image
  2. we decide to select that image
  3. we start rendering this
  4. we remove the old fake selection container (note: selection containers are rendered in the closest editable parent element; in CKE4 they were always rendered in the root editable – this is a coincident and perhaps could be changed)
  5. we focus the editable in which the new selection will be rendered
  6. this causes some selection change (perhaps because the old fake sel container was removed)
  7. this breaks the rendering or perhaps causes another rendering to be triggered

@Reinmar Reinmar modified the milestones: iteration 23, iteration 22 Feb 18, 2019
Reinmar added a commit to ckeditor/ckeditor5-engine that referenced this issue Feb 19, 2019
Fix: Fake selection container should be correctly appended to the new editable element when creating a new fake selection in a different editable element than the one which was focused before. Closes [ckeditor/ckeditor5#1523](ckeditor/ckeditor5#1523).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

3 participants