-
Notifications
You must be signed in to change notification settings - Fork 160
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
[BUG] Combination works only once if similar sequence exists #219
Comments
I think I had/have a similar bug. Event only firing once and then no more. This only happens when the When I have multiple So instead of doing:
|
+1 experiencing this behavior. @JoiGud your solution worked. Thanks! |
Thanks for the great write-up, @mativs. This looks like it's a complicated one and I'm running out of time I have available to work on this library today, so this will need looking into further. |
@greena13 thanks for the answer. Let me know if I can help in any way. |
I'm seeing this issue as well, it only seems to affect hotkeys incorporating const hotkeyMapA = {
altDownListener: { sequence: 'alt', action: 'keydown' }, // Fires only once
altUpListener: { sequence: 'alt', action: 'keyup' }, // Will never fire under any circumstance
};
const hotkeyMapB = {
altUpListener: 'alt', // Fires only once, then document.activeElement seemingly must change before it fires again
}; |
I'll just bump this and say I'm also seeing the same problem. The workaround that involves using a new element for each single keymap is pretty annoying, if anyone has a better solution I'd love to hear it :) |
This solved it for me #209 (comment): Adding either of these worked around this issue for me:
|
It's worth noting that using |
Describe the bug
First of all, I really like this library, is awesome thanks in advance!!
I am really not sure if this is a bug but I tried to check everything before opening this issue.
I am setting two keyamps (
alt+w m
,alt+i
). The first one works fine butalt+i
works only once. If I transform the first one into a combination instead of a sequence works fine. If I leave the browser and return (alt tab) works again once and stop working.How are you using react hotkeys components? (HotKeys, GlobalHotKeys, IgnoreKeys etc)
GlobalHotKeys
Expected behavior
I expect that the shortcut keeps working every type I press the combination.
Platform (please complete the following information):
Example Code
I created a new
create-react-app
and added the minimum possible codeAre you willing and able to create a PR request to fix this issue?
I am not sure if I will be able to fix this.
Include the smallest log that includes your issue:
Let me know If you need more information or anything, and sorry for my typos english is not my native language.
Thanks again
The text was updated successfully, but these errors were encountered: