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] Keydown event because it had an old focus tree #251

Open
rzseattle opened this issue Oct 29, 2019 · 1 comment
Open

[BUG] Keydown event because it had an old focus tree #251

rzseattle opened this issue Oct 29, 2019 · 1 comment

Comments

@rzseattle
Copy link

rzseattle commented Oct 29, 2019

Hey
I've noticed strange behaviour.

Demo:
https://codesandbox.io/s/react-hotkeys-6vexl?fontsize=14

If we focus "container 1" and press esc we'll see "Container 1 ESC" that is ok.
If we press the "change" button we'll show "container 2" and after focus it and press ESC in the console we'll see "Container 2 ESC" - like expected.

And now we can change focus as much as we want. We can show and hide container 2 by button and everything work as expected.

Bug
But... Container 2 got action for "enter" key. This action doing the same thing as the "change" button but by HotKeys handler. After we press "enter" key when container 2 is focused - ESC handlers don't work anymore on any container.

Strange
If i add

simulateMissingKeyPressEvents: false 

option. The handler will work on 3rd ESC press

Expected behavior
ESC handlers work after we use "enter' when container 2 is focused.

Platform

  • react-hotkeys 2.0.0
  • chrome
  • OS: Ubuntu
@greena13
Copy link
Owner

greena13 commented Jan 1, 2020

Thanks for posting your issue.

Unfortunately I do not have the time to actively work on this package, but I am seeking other active maintainers. If you are willing to create a pull request or help out, that would be an excellent way of moving this forward.

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

2 participants