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

Allow keyboard options to be passed which disable the default hotkeys #450

Closed
wants to merge 1 commit into from

Conversation

thomsbg
Copy link
Contributor

@thomsbg thomsbg commented Aug 12, 2015

I needed to register a hotkey handler for ENTER that ran before the built-in one (for making a single line input that blurs when enter is pressed). Since using addHotkey adds a handler to run AFTER the built-in one, I was stuck.

The solution I came up with lets you selectively disable any of the default handlers, which may be useful in its own right.

@jhchen
Copy link
Member

jhchen commented Aug 12, 2015

I think we were looking into adding a removeHotkey function from our discussion in #110. Is this still the intention @kmoe? I would prefer code over configuration. I think this would solve the problem as well @thomsbg?

I would also caution against just removing the default enter handler. Browsers are very inconsistent in their behavior which can lead to frustrating bugs. But it sounds like what you were originally trying to do (add a handler before the default one) would work just fine. Perhaps the removeHotkey function can return the handler(s) removed so it can be added back if one just wanted to change the order.

@thomsbg
Copy link
Contributor Author

thomsbg commented Aug 13, 2015

A removeHotkey function would be a sufficient, though roundabout solution to my problem. I can see the appeal of code over configuration, so I'll close this for now. I can whip together a PR for removeHotkey if @kmoe hasn't started yet.

@thomsbg thomsbg closed this Aug 13, 2015
@kmoe
Copy link
Contributor

kmoe commented Aug 17, 2015

Hey both - apologies, I haven't got the PR together for this yet. @thomsbg are you happy to do it? Let me know if you have any questions.

@kmoe
Copy link
Contributor

kmoe commented Aug 17, 2015

Aha, just seen #453!

@thomsbg thomsbg deleted the keyboard-options branch May 21, 2018 20:01
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.

3 participants