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
- Be on Windows and a Webkit browser
- 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
- 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:
`
!CKEDITOR.env.mac && data.ctrlKey ) ) { |
`
To add a !data.altKey
check on Windows.
`
!CKEDITOR.env.mac && data.ctrlKey && !data.altKey ) ) { |
`
Change History (3)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
Status: | new → pending |
---|---|
Version: | 4.6.2 |
I have a huge problem reproducing this issue.
- Could you tell me which OS you use?
- Provide a screen shot of your language and keyboard settings - maybe I have done something wrong there.
- 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
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.
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
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:
To add a
!data.altKey
check on Windows.