Skip to content

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

@juansalvatore

Description

@juansalvatore

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions