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

AltGr+A selects editor content with widget at the start or end instead of typing a diacritic "a" #1419

Closed
santaclaus21 opened this issue Jan 9, 2018 · 5 comments
Labels
good first issue Relatively easy to fix. This is a perfect issue if you are willing to create a Pull Request. plugin:widgetselection The plugin which probably causes the issue. regression This issue is a regression. status:confirmed An issue confirmed by the development team. target:minor Any docs related issue that can be merged into a master or major branch. type:bug A bug.
Milestone

Comments

@santaclaus21
Copy link

santaclaus21 commented Jan 9, 2018

Are you reporting a feature request or a bug?

Bug

Provide detailed reproduction steps (if any)

  1. Set keyboard input language to Polish.
  2. Open CKEditor 4 instance with a Enhanced Image plugin.
  3. Set content using "Source" button to the following HTML:
<figure class="image"><img alt="Saturn V" src="assets/image1.jpg" width="200" />
<figcaption>Roll out of Saturn V on launch pad</figcaption>
</figure>

<p><strong>Apollo 11</strong> was the spaceflight ...</p>
  1. Put selection in Apollo 11 ^was the spaceflight ...
  2. Type a ą diacritic character by pressing cmd/ctrl+alt+a.

Expected result

"ą" character being typed, nothing else happens.

Actual result

"ą" character is typed, but whole editor content is being selected.

Whole content being selected

Other details

Cannot reproduce the issue on a mac, seems like the only Windows system problem.

  • Browser: Chrome
  • OS: Windows 10
@mlewand mlewand self-assigned this Jan 9, 2018
@mlewand
Copy link
Contributor

mlewand commented Jan 9, 2018

config.keystrokes property has an explicit information on how to disable all the keystrokes.

Moreover, Polish letter are not produced by pressing Alt + <char> but it's AltGr key which is a slightly different key, to keep it short let's say that it acts as ctrl+alt pressed together.

However I can see what is the source of this issue - our widget selection plugin is attempting to make a selection on ctrl/cmd + a without checking alt key - this it triggers in altgr + a too, which it should not.

I'll just mention that this case will happen only if you have a widget either on a very beginning or end of your content.

I don't see a quick viable workaround for that other than temporarily changing content, which is rather painful.

That being said, I'll put it in the upcoming milestone.

@santaclaus21
Copy link
Author

santaclaus21 commented Jan 9, 2018

@mlewand thank you for explain. Yes, this is case when I have got widget (called "bootstrap grid") at the beginning.

I was trying to temporary fix it by preventDefault, without success on CKEditor..
$(document).keydown(function(objEvent) { if (objEvent.ctrlKey) { if (objEvent.keyCode == 65) { objEvent.preventDefault(); console.log('catch'); } } });

The problem with widget is that first "AltGr+A" insert "ą" and is selecting all (like Ctrl+A) and second one call this keystroke.. remove all CKEditor content ... ;]

@mlewand
Copy link
Contributor

mlewand commented Jan 9, 2018

I have simplified the issue description. Dropping original content for a reference:

Bug.

I have got some problems with widgets and Alt+A keystroke. Alt+A (polish "ą") is working for me like Ctrl+A (?). I have not found solution to fix it, so I was trying to disable this > keystroke...

while changing keystroke is working...
config.keystrokes = [ [ CKEDITOR.CTRL + 65, 'link' ], [ CKEDITOR.ALT + 65, 'link' ], [ CKEDITOR.ALT + CKEDITOR.CTRL + 65, 'link' ] ];

I can't disable these keystrokes and this code is not working (false, null, emty string):
config.keystrokes = [ [ CKEDITOR.CTRL + 65, false ], [ CKEDITOR.ALT + 65, false ], [ CKEDITOR.ALT + CKEDITOR.CTRL + 65, false ] ];

Disable all keystrokes also do nothing:
config.keystrokes = [];

@mlewand mlewand added type:bug A bug. status:confirmed An issue confirmed by the development team. plugin:widgetselection The plugin which probably causes the issue. regression This issue is a regression. target:minor Any docs related issue that can be merged into a master or major branch. labels Jan 9, 2018
@mlewand mlewand added this to the 4.8.1 milestone Jan 9, 2018
@mlewand mlewand changed the title disable Alt+A/Ctrl+A keystoke Typing a diacritic character involving "a" key selects entire contents with a widget at beginning or end of the content Jan 9, 2018
@mlewand
Copy link
Contributor

mlewand commented Jan 9, 2018

I tried to provide a meaningful summary, but I feel I failed badly (wayyy too long)!

@AnnaTomanek please, help, help 🙂

@mlewand mlewand removed their assignment Jan 9, 2018
@AnnaTomanek AnnaTomanek changed the title Typing a diacritic character involving "a" key selects entire contents with a widget at beginning or end of the content AltGr+A selects editor content with widget at the start or end instead of typing a diacritic "a" Jan 9, 2018
@mlewand mlewand added the good first issue Relatively easy to fix. This is a perfect issue if you are willing to create a Pull Request. label Jan 9, 2018
@mlewand mlewand modified the milestones: 4.8.1, 4.9.0 Jan 17, 2018
@lslowikowska
Copy link

Hey @santaclaus21 just to let you know, the fix has been merged into the master branch - we have just decided to skip the minor release (4.8.1) and go straight to 4.9.0, which means that this fix will be released with 4.9.0, too (check the milestones page).

If you can't wait for it, you can download the nightly release from the "CKEditor Nightly Build" section on our download page. Keep in mind, however, that it has not been verified by our integration testing phase yet as we will do this right before the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Relatively easy to fix. This is a perfect issue if you are willing to create a Pull Request. plugin:widgetselection The plugin which probably causes the issue. regression This issue is a regression. status:confirmed An issue confirmed by the development team. target:minor Any docs related issue that can be merged into a master or major branch. type:bug A bug.
Projects
None yet
Development

No branches or pull requests

3 participants