Closed tobyzerner closed 4 years ago
Hey @tobyzerner thanks for the issue!
This library explicitly ignores shortcuts fired in form fields because it can be very problematic with regard to accessibility.
If you need to enable those kind of shortcuts, it's recommended to bind an event listener directly to handle that specific use case. We do this at GitHub; hotkey
is used as a convenience layer but cases that need more fine tuning are done manually.
Hey @tobyzerner thanks for the issue!
This library explicitly ignores shortcuts fired in form fields because it can be very problematic with regard to accessibility.
If you need to enable those kind of shortcuts, it's recommended to bind an event listener directly to handle that specific use case. We do this at GitHub;
hotkey
is used as a convenience layer but cases that need more fine tuning are done manually.
@keithamus How is this done with the command palette in github and listening to meta+k
on all inputs across github?
Thanks for the great lib!
Currently in the
keyDownHandler
I see this:In my use-case I would like to attach an "Escape" hotkey to a cancel button, and a "Command+Enter" hotkey to a submit button, and have these hotkeys be active whilst the focus is in an input/textarea. The above line prevents this.
Understandable that single character and Shift+* hotkeys shouldn't be active, but what about everything else? What's the recommended approach here?