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

CTRL + A on selected image moves the caret to the beginning of the editor #465

Closed
Mgsy opened this Issue Jun 8, 2017 · 2 comments

Comments

@Mgsy
Member

Mgsy commented Jun 8, 2017

Steps to reproduce

  1. Open a sample with an image.
  2. Select the image.
  3. Press CTRL + A.

Current result

Selection shows up for a moment, then breaks and the caret moves to the beginning of the editor.

GIF

bug

Other information

OS: Windows 10, MacOS X
Browser: Chrome, Safari, Firefox, Edge, Opera
Release: 0.10.0

@Mgsy Mgsy added the type:bug label Jun 8, 2017

@Reinmar

This comment has been minimized.

Member

Reinmar commented Jun 21, 2017

That's because when the user presses Ctrl+A the browser creates such a selection:

<p>[foo</p>
<image/>
<div hidden-selection-container>image widget]</div>

And then we remove the hidden selection container because we notice that the fake selection is gone.

I can imagine a couple of solutions:

  • Intercepting the keystroke early and handling it on our own. This will be needed for ckeditor/ckeditor5-image#55 anyway, so maybe we should handle it everywhere just to make it consistent. We'll also need to handle selecting the entire content when widget is the first/last element in the editable (I can't find a ticket for it now ;|).
  • Fixing the selection which ends in/after the hidden selection container when removing it.
  • Some hybrid solution combining intercepting the "select all" action and fixing the selection.
@szymonkups

This comment has been minimized.

Contributor

szymonkups commented Oct 19, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment