ProseMirror / prosemirror

The ProseMirror WYSIWYM editor
http://prosemirror.net/
MIT License
7.62k stars 336 forks source link

Entering `Mod+[` in Mac+Chrome triggers browser shortcut before key handling in prosemirror #1303

Open MH4GF opened 2 years ago

MH4GF commented 2 years ago

Issue details

On Mac+Chrome, keyboard shortcut Mod+[ triggers browser shortcut before key handling in prosemirror, therefore, even if keymap is defined, it will open the previous page. This problem occurs only on Mac+Chrome, not on Windows+Chrome/Mac+Safari, etc. Other browsers will browser back if there is no valid command in the keymap defined by prosemirror.

Steps to reproduce

It is also happening in https://prosemirror.net/ Input a nested list like the one below, and entering Mod+[

- aa
  - bb<cursor>

Affected platforms

So far I found that only Mac+Chrome has this issue (tested on windows+chrome, mac+chrome/safari/firefox)

ref: https://support.google.com/chrome/answer/157179?hl=en&co=GENIE.Platform%3DDesktop#zippy=%2Cwebpage-shortcuts%2Cmouse-shortcuts%2Caddress-bar-shortcuts%2Ctab-window-shortcuts%2Cgoogle-chrome-feature-shortcuts

marijnh commented 2 years ago

It looks like those keys only take effect when the ProseMirror bindings don't apply (i.e. when liftListItem or sinkListItem does nothing).

MH4GF commented 2 years ago

t looks like those keys only take effect when the ProseMirror bindings don't apply

yeah, I understand that is the expected behavior, but Mac + Chrome seems to take effect browsers shortcut before ProseMirror bindings, even if applied.


I forgot to mention the version. Chrome: Version 103.0.5060.134 (Official Build) (x86_64) Mac: macOS Monterey Version 12.4

marijnh commented 2 years ago

What I'm saying is when I try this, that's not what happens.