-
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] keydown and keyup events repeat if key is held down #177
Comments
Hi @chrisella, thanks for the great write-up. This is a strange one. You are correct, that when you hold down My only guess at this point is it has something to do with the way triggering your Redux events is causing the JavaScript engine to switch between evaluating events. The other possibility is that somehow |
Hey, check this out: ccampbell/mousetrap#128 (comment) |
Thanks @shtrih ! That's working a charm, I never knew that existed on the event data. |
Hey @chrisella. I'm afraid I still can't reproduce your issue, however I've fixed some issues similar to this one in v2.0.0-pre7. Are you able to confirm whether it's still happening? |
I'm happy to report that I was finally able to reproduce this issue and craft a fix. It should go out in the next release. |
Fix is now available in v2.0.0-pre8. |
Describe the bug
Holding down a single key which is mapped continually triggers the handler until it is released.
How are you using react hotkeys components? (HotKeys, GlobalHotKeys, IgnoreKeys etc)
GlobalHotKeys
Expected behavior
I would expect to see the keydown action triggered once when the key is depressed and then nothing until I release when a keyup would occur.
What I actually see (which is highlighted by the fact I raise events in Redux for the down and up) is continuous down actions until I release.
Platform (please complete the following information):
APPLICABLE TO v2.0.0-pre1 AND ABOVE: ======================
What Configuration options are you using?
None
The text was updated successfully, but these errors were encountered: