Opened 8 years ago

Last modified 8 years ago

#16848 pending Bug

Selecting all triggering on certain characters

Reported by: Mark Wade Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Steps to reproduce

  1. Be on Windows and a Webkit browser
  2. Position the cursor in such a way that pressing Ctrl+A will, using the code added in https://github.com/ckeditor/ckeditor-dev/commit/c08aa2ca61a7119f56a9805a8b959ffa83f38457, select all editor contents
  3. Press Ctrl+*Alt*+A

Expected result

Ctrl+Alt+A is used to enter the character ą on a US keyboard layout. The ą character should be inserted.

Actual result

The editor's contents are selected.

Other details (browser, OS, CKEditor version, installed plugins)

Suggested fix (which actually probably explains the issue better than the above description)

plugins/widgetselection/plugin.js

Change:

`

if ( evt.data.getKey() == 65 && ( CKEDITOR.env.mac && data.metaKey
!CKEDITOR.env.mac && data.ctrlKey ) ) {

`

To add a !data.altKey check on Windows.

`

if ( evt.data.getKey() == 65 && ( CKEDITOR.env.mac && data.metaKey
!CKEDITOR.env.mac && data.ctrlKey && !data.altKey ) ) {

`

Change History (3)

comment:1 Changed 8 years ago by Mark Wade

Whoops, formatting got a bit confused there

Suggested fix (which actually probably explains the issue better than the above description)

plugins/widgetselection/plugin.js

Change:

if ( evt.data.getKey() == 65 && ( CKEDITOR.env.mac && data.metaKey || !CKEDITOR.env.mac && data.ctrlKey ) ) {

To add a !data.altKey check on Windows.

if ( evt.data.getKey() == 65 && ( CKEDITOR.env.mac && data.metaKey || !CKEDITOR.env.mac && data.ctrlKey && !data.altKey ) ) {

comment:2 Changed 8 years ago by Jakub Ś

Status: newpending
Version: 4.6.2

I have a huge problem reproducing this issue.

  1. Could you tell me which OS you use?
  2. Provide a screen shot of your language and keyboard settings - maybe I have done something wrong there.
  3. Provide sample content or a screen cast showing what needs to be at the start and where exactly I need to click?

I have tried multiple variations of below HTML, I have tried clicking before, into and after the widget. All worked as expected.

<p><img alt="" height="62" src="http://cdn.arstechnica.net/wp-content/uploads/2016/02/5718897981_10faa45ac3_b-640x624.jpg" width="64" /></p>
<p>test</p>
<p>test</p>
<p>test</p>
<p><img alt="" height="62" src="http://cdn.arstechnica.net/wp-content/uploads/2016/02/5718897981_10faa45ac3_b-640x624.jpg" width="64" /></p>

comment:3 Changed 8 years ago by Brandon

I work with @MarkWade and we worked together to isolate the issue and identify the cause of the problem we were facing.

1) I am using Windows 10 (10.0.14393 Build 14393) specifically. Note that I am only reproducing this with Chrome and not Firefox. 2) This issue can be reproduced with some different keyboards, but specifically I used Polish.

https://content.screencast.com/users/bfarber/folders/Jing/media/fa64fbfb-708a-40c2-809d-1f948b99d521/2017-02-10_2219.png

https://content.screencast.com/users/bfarber/folders/Jing/media/3b1303bf-0839-4b61-b370-f95a209e87e3/2017-02-10_2219.png

After you install the Polish language pack, select the Polish keyboard. After you have done this, you can hit left CTRL+ALT+A to insert the ą character into any text input (including a CKEditor instance).

3) The key to reproducing this (I think) is that you must have content that has contenteditable=false in the editor. Specifically, this is the first thing in the editor (as captured by Firebug inspector)

<div tabindex="-1" data-cke-widget-wrapper="1" data-cke-filter="off" 
class="cke_widget_wrapper cke_widget_block cke_widget_ipsquote 
cke_widget_wrapper_ipsQuote cke_widget_selected" data-cke-display-name="blockquote" 
data-cke-widget-id="1" role="region" aria-label="blockquote widget" 
contenteditable="false">
<blockquote class="ipsQuote cke_widget_element" data-ipsquote="" data-cke-widget-data="
%7B%22classes%22%3A%7B%22ipsQuote%22%3A1%7D%7D" data-cke-widget-upcasted="1" data-cke-widget-keep-attr="0" data-widget="ipsquote">
<div class="ipsQuote_citation">Quote</div>
<div class="ipsQuote_contents ipsClearfix cke_widget_editable" data-cke-widget-editable="content" data-cke-enter-mode="1" contenteditable="true">
<p>test</p>
</div>
</blockquote>
</div>

My cursor is after this in the editor, and then if you hit CTRL+ALT+A to insert the Polish character, everything in the editor becomes selected. Here is a short video showing this:

https://www.screencast.com/t/PymElnLJgc

If we change this line in widgetselection/plugin.js

if ( evt.data.getKey() == 65 && ( CKEDITOR.env.mac && data.metaKey || !CKEDITOR.env.mac && data.ctrlKey ) ) {

to

if ( evt.data.getKey() == 65 && ( CKEDITOR.env.mac && data.metaKey || !CKEDITOR.env.mac && data.ctrlKey && !data.altKey ) ) {

it fully resolves the issue

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy