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

Fixed alt + a key combination for editor content selection on Windows #1423

Merged
merged 8 commits into from
Jan 16, 2018

Conversation

jacekbogdanski
Copy link
Member

@jacekbogdanski jacekbogdanski commented Jan 9, 2018

What is the purpose of this pull request?

Bug fix

Does your PR contain necessary tests?

All patches which change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.

This PR contains

  • Unit tests
  • Manual tests

What changes did you make?

Used CKEDITOR.dom.event.getKeystroke function to define content selection by cmd/ctrl+a key combination.

Closes #1419

@mlewand mlewand self-requested a review January 11, 2018 08:56
Copy link
Contributor

@mlewand mlewand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm missing a unit test. It should be possible to set editor with a widget at the beginning of the content, and then fake fire key combinations on it.

There should be at least two cases:

  • ctrl+65
  • ctrl+alt+65

As for your communication, it's not about Alt key but AltGr key which is a slightly different case.

Other than that looks OK.


Test should be performed on a Windows operating system with polish keyboard layout. You can't validate this test case on UNIX based systems.

1. Set system settings to use polish keyboard layout.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Polish keyboard layout (...)


----

Test should be performed on a Windows operating system with polish keyboard layout. You can't validate this test case on UNIX based systems.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Polish keyboard layout (...)

@@ -0,0 +1,13 @@
<div id="editor01">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awkward name for the editor. We typically set it just to editor1. 🙂

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have changed name in CKEDITOR.replace call, but you left this div without a change, thus manual test is breaking and doesn't work.

<script>
var config = {
height: 200,
allowedContent: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no reason for disabling ACF with allowedContent: true. Actually yhere's no need for custom config at all.

2. Focus editor instance.
3. Press `Alt + a` to insert `ą` letter.

**Expected:**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use headers for expected / unexpected sections.

@mlewand
Copy link
Contributor

mlewand commented Jan 15, 2018

@jacekbogdanski could you please change the name of editor too? See #1423 (comment)

Copy link
Contributor

@mlewand mlewand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still some issues.

I'll fix them in a follow up commits.

There was also an issue I fixed in 500ac4f - p[contenteditable] was actually removed, since it was not allowed, so the manual test was not checking the actual problem (as it was changed to a regular paragraph).

## Expected
`ą` letter has been inserted at the caret position. Editor content has not been selected.

## Expected
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an Unexpected result.

@@ -0,0 +1,13 @@
<div id="editor01">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have changed name in CKEDITOR.replace call, but you left this div without a change, thus manual test is breaking and doesn't work.

@mlewand
Copy link
Contributor

mlewand commented Jan 16, 2018

Pushed corrections, and rebased onto latest master branch.

@mlewand mlewand merged commit 4a8c9de into master Jan 16, 2018
@mlewand mlewand deleted the t/1419 branch February 22, 2018 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants