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

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
Closed
Assignees
Labels
package:engine package:widget type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@Mgsy
Copy link
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 This issue reports a buggy (incorrect) behavior. label Jun 8, 2017
@Reinmar
Copy link
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 https://github.com/ckeditor/ckeditor5-image/issues/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
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine package:widget type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

3 participants