JohannesKlauss / react-hotkeys-hook

React hook for using keyboard shortcuts in components.
https://react-hotkeys-hook.vercel.app/
MIT License
2.56k stars 112 forks source link

[BUG] Hotkeys stuck on `contextmenu` event. #1151

Open ablakey opened 3 months ago

ablakey commented 3 months ago

If a key is pressed then the user right clicks to open the context menu, the key never unpresses and is "stuck".

This is the same issue fixed by: https://github.com/JohannesKlauss/react-hotkeys-hook/pull/892 but instead of blur, contextmenu causes the stuck key.

Would you consider this to be a bug? If so, I'd be happy to author a fix and a test.

Desktop (please complete the following information):

JohannesKlauss commented 3 months ago

I think it makes sense to treat this as a bug, it is certainly unintentional behavior. I'd be happy to accept a PR for that.