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] hitting space twice breaks all events #308

Closed
TheYarin opened this issue May 2, 2021 · 1 comment
Closed

[BUG] hitting space twice breaks all events #308

TheYarin opened this issue May 2, 2021 · 1 comment

Comments

@TheYarin
Copy link

TheYarin commented May 2, 2021

Describe the bug
I have a text input I wanted to add some hotkeys to. Everything is working fine until the second 'space' is typed. Then, all of the hotkeys cease to work. In the log (level: debug) I see that it no longer captures new keydown events since the second 'space' is typed.
This behavior is fixed when I set the simulateMissingKeyPressEvents configuration to false, but that breaks the ctrl+alt+enter hotkey which I'm also using so it's not good enough.

How are you using react hotkeys components? (HotKeys, GlobalHotKeys, IgnoreKeys etc)
HotKeys component

Expected behavior
I expect the hotkeys to continue working even after hitting the space bar twice.

Platform (please complete the following information):

  • Version of react-hotkeys: 2.0.0
  • Browser [e.g. chrome, safari]: chrome
  • OS: [e.g. iOS]: Windows

Are you willing and able to create a PR request to fix this issue?
Probably not, sorry.

Include the smallest log that includes your issue:
I type 'f' and then space twice. On the second space, hotkeys stop working.

HotKeys (F1📗-E1💚-C1⭐️-P2🔷:) New 'f' keydown event.
AbstractKeyEventStrategy.js:429 HotKeys (F1📗-E1💚-C0🔺-P3🔶:) No matching actions found for 'f' keydown.
AbstractKeyEventStrategy.js:429 HotKeys (F1📗-E1💚-C1⭐️-P2🔷:) No matching actions found for 'f' keydown.
2AbstractKeyEventStrategy.js:429 HotKeys (F1📗-E1💚-C2🔷-P1⭐️:) No matching actions found for 'f' keydown.
AbstractKeyEventStrategy.js:429 HotKeys (F1📗-E1💚-C3🔶-P0🔺:) No matching actions found for 'f' keydown.
FocusOnlyKeyEventStrategy.js:298 HotKeys (F1📗-E2💙-C1⭐️-P2🔷:) New 'f' keypress event.
FocusOnlyKeyEventStrategy.js:188 HotKeys (F1📗-C3🔶-P0🔺:) Received new props.
FocusOnlyKeyEventStrategy.js:188 HotKeys (F1📗-C2🔷-P1⭐️:) Received new props.
FocusOnlyKeyEventStrategy.js:188 HotKeys (F1📗-C1⭐️-P2🔷:) Received new props.
FocusOnlyKeyEventStrategy.js:298 HotKeys (F1📗-E3💛-C1⭐️-P2🔷:) New 'f' keyup event.
FocusOnlyKeyEventStrategy.js:298 HotKeys (F1📗-E4💜-C1⭐️-P2🔷:) New ' ' keydown event.
AbstractKeyEventStrategy.js:429 HotKeys (F1📗-E4💜-C0🔺-P3🔶:) No matching actions found for ' ' keydown.
AbstractKeyEventStrategy.js:429 HotKeys (F1📗-E4💜-C1⭐️-P2🔷:) No matching actions found for ' ' keydown.
2AbstractKeyEventStrategy.js:429 HotKeys (F1📗-E4💜-C2🔷-P1⭐️:) No matching actions found for ' ' keydown.
AbstractKeyEventStrategy.js:429 HotKeys (F1📗-E4💜-C3🔶-P0🔺:) No matching actions found for ' ' keydown.
FocusOnlyKeyEventStrategy.js:298 HotKeys (F1📗-E6❤️-C1⭐️-P2🔷:) New (simulated) ' ' keypress event.
FocusOnlyKeyEventStrategy.js:339 HotKeys (F1📗-E6❤️-C0🔺-P3🔶:) Ignored (simulated) ' ' keypress as it was not expected, and has already been simulated.
EventPropagator.js:252 HotKeys (F1📗-E6❤️-C1⭐️-P2🔷:) Stopping further event propagation.
FocusOnlyKeyEventStrategy.js:339 HotKeys (F1📗-E6❤️-C1⭐️-P2🔷:) Ignored ' ' keypress as it was not expected, and has already been simulated.
EventPropagator.js:252 HotKeys (F1📗-E6❤️-Cnull🔺) Stopping further event propagation.
FocusOnlyKeyEventStrategy.js:188 HotKeys (F1📗-C3🔶-P0🔺:) Received new props.
FocusOnlyKeyEventStrategy.js:188 HotKeys (F1📗-C2🔷-P1⭐️:) Received new props.
FocusOnlyKeyEventStrategy.js:298 HotKeys (F1📗-E7💚-C0🔺-P3🔶:) New ' ' keyup event.
FocusOnlyKeyEventStrategy.js:298 HotKeys (F1📗-E8💙-C0🔺-P3🔶:) New ' ' keydown event.
AbstractKeyEventStrategy.js:429 HotKeys (F1📗-E8💙-C0🔺-P3🔶:) No matching actions found for ' ' keydown.
AbstractKeyEventStrategy.js:429 HotKeys (F1📗-E8💙-C1⭐️-P2🔷:) No matching actions found for ' ' keydown.
AbstractKeyEventStrategy.js:429 HotKeys (F1📗-E8💙-C2🔷-P1⭐️:) No matching actions found for ' ' keydown.
AbstractKeyEventStrategy.js:429 HotKeys (F1📗-E8💙-C3🔶-P0🔺:) No matching actions found for ' ' keydown.
FocusOnlyKeyEventStrategy.js:298 HotKeys (F1📗-E10💜-C0🔺-P3🔶:) New (simulated) ' ' keypress event.
FocusOnlyKeyEventStrategy.js:339 HotKeys (F1📗-E10💜-C0🔺-P3🔶:) Ignored ' ' keypress as it was not expected, and has already been simulated.
EventPropagator.js:252 HotKeys (F1📗-E10💜-Cnull🔺) Stopping further event propagation.
FocusOnlyKeyEventStrategy.js:188 HotKeys (F1📗-C3🔶-P0🔺:) Received new props.

Any typing from this point on only logs "received new props", no events.

What Configuration options are you using?

configure({
ignoreTags: []
})

Also, allowChanges is set to true.

@TheYarin
Copy link
Author

TheYarin commented May 3, 2021

Seems like this issue was already reported, sorry for not properly checking prior to posting.

@TheYarin TheYarin closed this as completed May 3, 2021
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

1 participant