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

Add method to allow the adding of custom bindings #565

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

Conversation

sambenne
Copy link

I wanted to add a new keyboard shortcut but was unable to. This is because the list of bindings was set and no way to update it. This change adds a method that allows the user to add new bindings so you can have custom keyboard shortcuts

@sambenne
Copy link
Author

So for instance you can then do:

EasyMDE.prototype.addBinding('submitModal', keyboardAction);

Then when you are creating the instance you can do:

shortcuts: {
    "submitModal": "Ctrl-Enter"
}

@Ionaru
Copy link
Owner

Ionaru commented Oct 11, 2023

This looks great! I'm gonna do some testing and add the typings soon!

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