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

[BUG] Pressing the spacebar with no element focused breaks the event listeners #303

Open
juansalvatore opened this issue Mar 10, 2021 · 2 comments

Comments

@juansalvatore
Copy link

Describe the bug

Pressing the spacebar breaks the event listeners for a bit if nothing is focused. When focusing on an element pressing spacebar doesn't break react-hotkeys.
I'm using the HotKeys component

Expected behavior
Pressing the spacebar should work as expected and not break react-hotkeys

Platform (please complete the following information):

  • Version of react-hotkeys 2.0.0
  • Browser: chrome and firefox developer
  • OS: mac os

Include the smallest log that includes your issue:

HotKeys (F20📕-C0🔺-P0🔺:) Focused. 
FocusOnlyKeyEventStrategy.js:153
HotKeys (F20📕-E303💛-C0🔺-P0🔺:) New ' ' keydown event. FocusOnlyKeyEventStrategy.js:298
HotKeys (F20📕-E303💛-C0🔺-P0🔺:) No matching actions found for ' ' keydown. AbstractKeyEventStrategy.js:429
HotKeys (F20📕-E305🧡-C0🔺-P0🔺:) New (simulated) ' ' keypress event. FocusOnlyKeyEventStrategy.js:298
HotKeys (F20📕-E305🧡-C0🔺-P0🔺:) Ignored ' ' keypress as it was not expected, and has already been simulated. FocusOnlyKeyEventStrategy.js:339
HotKeys (F20📕-E305🧡-Cnull🔺) Stopping further event propagation.
@juansalvatore juansalvatore changed the title [BUG] Space breaks the event listeners [BUG] Pressing the spacebar with no element focused breaks the event listeners Mar 10, 2021
@nopol10
Copy link

nopol10 commented Mar 28, 2021

Try the react-hotkeys-ce package on npm. It has the latest code from this repo and most probably contains a fix for this.

@jhyman2
Copy link

jhyman2 commented Apr 28, 2021

Try the react-hotkeys-ce package on npm. It has the latest code from this repo and most contains a fix for this.

Thank you @nopol10 !!!! I was about to have to abandon a feature I had been working on for weeks because of this bug, and then I tried what you suggested and it fixed all the problems.

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

No branches or pull requests

3 participants