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

Some CKEditor keyboard shortcuts conflict with Mac OS shortcuts #5705

Closed
jswiderski opened this issue Nov 4, 2019 · 4 comments · Fixed by #9057
Closed

Some CKEditor keyboard shortcuts conflict with Mac OS shortcuts #5705

jswiderski opened this issue Nov 4, 2019 · 4 comments · Fixed by #9057
Assignees
Labels
package:utils squad:core Issue to be handled by the Core team. support:2 An issue reported by a commercially licensed client. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@jswiderski
Copy link

📝 Provide detailed reproduction steps (if any)

CKEditor uses key shortcuts which conflict with Mac OS shortcuts. For example for Bold and for Link both shortcuts work: CMD+B and Ctrl+B for Bold, CMD+K and Ctrl+K for Link. The problem is that on Mac Control-K means "Delete the text between the insertion point and the end of the line or paragraph" and Control-B means "Move one character backward" - https://support.apple.com/en-us/HT201236.

The reason is because when meta (Cmd) key is pressed, it is treated as Ctrl key by the editor.

✔️ Expected result

When Ctrl+K or Ctrl+B is pressed, Mac OS commands should be executed.
CKEditor commands should only be executed when Cmd+K or Cmd+B is pressed.

❌ Actual result

When Ctrl+K, Cmd+K or Ctrl+B, Cmd+B is pressed, CKEditor commands are executed.
Mac OS commands are not executed at all.

📃 Other details

  • Browser: Any
  • OS: Mac OS
  • CKEditor version: 15
  • Installed CKEditor plugins: N/A

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@jswiderski jswiderski added the type:bug This issue reports a buggy (incorrect) behavior. label Nov 4, 2019
@jswiderski
Copy link
Author

From what I have checked these two Mac OS shortcuts can be replaced: Control-B with Left Arrow and Control-K with Shift+Command+Right Arrow and Delete.

@Reinmar
Copy link
Member

Reinmar commented Nov 4, 2019

Hm... I copied this behaviour from CKEditor 4. It also treats Ctrl and Cmd as the same key and I don't think that there were complains about this.

But we could, most likely, fix it. Although, I'd be most worried about the safety of this change – how well we can recognize that we're on macOS.

@Reinmar Reinmar added this to the nice-to-have milestone Nov 4, 2019
@oleq
Copy link
Member

oleq commented Nov 5, 2019

But we could, most likely, fix it. Although, I'd be most worried about the safety of this change – how well we can recognize that we're on macOS.

We have env.isMac already that is based on the UA string. I checked how it works and in Chrome, Firefox, and Safari, it does contain the 'macintosh' substring so I think we're safe.

TBH we're the only editor that acts this way so this actually could be an issue for some people.

@oleq
Copy link
Member

oleq commented Feb 12, 2021

@lslowikowska lslowikowska added the support:2 An issue reported by a commercially licensed client. label Feb 16, 2021
@oleq oleq modified the milestones: nice-to-have, iteration 40 Feb 18, 2021
oleq added a commit that referenced this issue Feb 23, 2021
Fix (utils): The keystrokes are no longer conflicting on macOS. Closes #5705.

Feature (utils): Added forced modifier key (`Ctrl!`) for keystrokes that should not be mapped to <kbd>Command</kbd> on macOS.

Other (engine): The `KeyObserver` should provide information about `metaKey` being pressed.

Other (list): The to-do list item toggle keystroke changed to <kbd>Ctrl</kbd>+<kbd>Enter</kbd> (<kbd>Cmd</kbd>+<kbd>Enter</kbd> on Mac).

Internal (typing): Any keypress while the <kbd>Cmd</kbd> key is pressed is not a typing keystroke.

BREAKING CHANGE: On macOS keystrokes with the <kbd>Ctrl</kbd> modifier will not be handled unless the modifier is registered as the forced one (for example: `Ctrl!+A` will not be translated to `Cmd+A` on macOS).

BREAKING CHANGE (list): The to-do list item toggle keystroke changed to <kbd>Ctrl</kbd>+<kbd>Enter</kbd> (<kbd>Cmd</kbd>+<kbd>Enter</kbd> on Mac).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:utils squad:core Issue to be handled by the Core team. support:2 An issue reported by a commercially licensed client. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants