hotkeys-js
hotkeys-js copied to clipboard
Not triggering when focus in on Input
Hi, I have an issue, when I try to trigger the shortcut on an input focused, this does not work, I have to click on background page to get the shortcut working properly. Can you help me with this?
@frankagr94
This example may be what you want. https://codepen.io/jaywcjlove/pen/OJLaXaw
Hi, I have an issue, when I try to trigger the shortcut on an input focused, this does not work, I have to click on background page to get the shortcut working properly. Can you help me with this?
You can read in docs: "By default hotkeys are not enabled for INPUT SELECT TEXTAREA elements.".
I missed that too 😅
hotkeys.filter = function(event){
return true;
}
Can we apply this filter per hotkey? because it seems to be global only atm.
Can we apply this filter per hotkey? because it seems to be global only atm.
after checkout the sourcecode, I think it is a global hook, and how can I to listening command+s even if an <input />
element was focus on but skip command+z
Can we apply this filter per hotkey? because it seems to be global only atm.
Maybe checking the data about the hotkey in event?
Or hotkeys.getScope();
?
I'm not able to reproduce it now, but I'm pretty sure it's possible.