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

preventDefault not working for keybindings on Google Chrome + macOS #673

Closed
Bardia95 opened this issue Jan 7, 2022 · 3 comments
Closed

Comments

@Bardia95
Copy link

Bardia95 commented Jan 7, 2022

Don't know if this is a CodeMirror 6 problem or a Google Chrome problem, but...

We have registered a custom keybinding for Ctrl/Cmd + Shift + / (aka Ctrl/Cmd + ?) with preventDefault set to true and it seems to be working everywhere and on every device, except for Google Chrome on macOS, where the default is not prevented, and the Chrome help menu opens up (which uses the same keybinding), while the custom action we've defined does not run. Other browsers have this same default behaviour but the default is prevented fine, even on Chrome on Windows, and our custom action we've defined does run.

I know that Chrome does in fact prevent some of their default key bindings to be overridden but there is no official list, and nowhere in any of their docs do they have any information regarding the Ctrl/Cmd + Shift + / keybinding at all. Either way, its weird that on Chrome on Windows there is no problem, but there is on macOS.

@marijnh
Copy link
Member

marijnh commented Jan 7, 2022

It's indeed possible that Chrome doesn't allow you to override this key combination. Does the same problem occur outside of CodeMirror? If so, I'd say it's not really something that CodeMirror can help.

@Hccake
Copy link

Hccake commented Feb 22, 2022

Same problem with Windows + Chrome.
keybind CTRL-S works fine in codemirro5,but occasionally failed in codemirror6

@marijnh
Copy link
Member

marijnh commented Feb 22, 2022

That doesn't sound like the same problem, so please open a new issue which describes what you're doing and what goes wrong.

Closing this one for inactivity.

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

No branches or pull requests

3 participants