You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is the current behavior intentional? Whether intentional or not, I think we need to change it in some way since the current behavior makes it very easy to write a bug. I am happy to help brainstorm and potentially submit a PR.
Workaround
Never pass in a falsy value like empty string or undefined as the first argument of useHotkeys. Instead, you can pass a nearly-impossible combination of keys like '1+2+3+4+5+6+7+8+9'. This effectively disables the hook without resulting in other handlers being unbound. You could probably achieve the same thing using using the hook's enabled option.
The text was updated successfully, but these errors were encountered:
Well the easiest fix would be to fix it in hotkeys-js package. Changing the line above the mentioned one to if (typeof keysInfo === 'undefined') will take care of it. So maybe it is better to raise this issue in the hotkeys-js repo
CodeSandbox that demonstrates the issue
It happens because of this line in hotkeys-js.
Is the current behavior intentional? Whether intentional or not, I think we need to change it in some way since the current behavior makes it very easy to write a bug. I am happy to help brainstorm and potentially submit a PR.
Workaround
Never pass in a falsy value like empty string or undefined as the first argument of
useHotkeys
. Instead, you can pass a nearly-impossible combination of keys like'1+2+3+4+5+6+7+8+9'
. This effectively disables the hook without resulting in other handlers being unbound. You could probably achieve the same thing using using the hook'senabled
option.The text was updated successfully, but these errors were encountered: