Skip to content

Fix custom shortcuts in HedgeDoc editor not always working #467

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

markfijneman
Copy link
Contributor

Instead of adding the shortcuts to HedgeDoc's CodeMirror editor directly by setting extraKeys, I disabled the filter on different input elements that hotkeys.js uses by default. (See https://wangchujiang.com/hotkeys-js/#filter). This allows the shortcuts defined by hotkeys.js to work in the editor as well.

Setting extraKeys also overrides the default shortcuts that CodeMirror defines, such as f10 to make the editor take up the full window. Since this code does not override this anymore, these shortcuts should work again after this change.

There should be no or little overlap with default CodeMirror hotkeys, but it is still a good idea to test if nothing breaks because of this change.

Closes #450

@JJ-8 JJ-8 self-requested a review April 14, 2025 18:16
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.

Custom HedgeDoc Editor shortcuts stop working after some time
1 participant