Skip to content
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

Fix/contextmenu stuck keys #1152

Closed

Conversation

ablakey
Copy link

@ablakey ablakey commented Mar 12, 2024

Fixes #1151

This fix is a bit different than the blur stuck keys fix. The problem is that if you're holding a key down, the keydown event sometimes fires a few times after the contextmenu event, thus setting them again after clear.

After quite a bit of testing, I believe the issue is that the contextmenu event enqueues before keydown events stop enquing. By calling clear asynchronously (using setTimeout to put it at the end of the queue) this seems to be fixed. I tested the blur fix for this bug, which doesn't seem to exist (in Chrome at least).

Given these are events, I don't think addressing it asynchronously is a problem: the behaviour is already async in nature.

Thank you for offering up your time to review my bug report and this proposed fix.

Copy link

vercel bot commented Mar 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-hotkeys-hook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 12, 2024 1:36pm

@ablakey
Copy link
Author

ablakey commented Apr 16, 2024

Going to close to keep my PR list clean. Feel free to re-open if you feel this is helpful. I'll gladly get involved again.

Thanks again for such a great library!

@ablakey ablakey closed this Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Hotkeys stuck on contextmenu event.
1 participant