Skip to content

Keyboard event handlers no longer invoked if document.body get's focus. #2846

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

Closed
Gozala opened this issue Jan 12, 2015 · 1 comment
Closed

Comments

@Gozala
Copy link

Gozala commented Jan 12, 2015

In my example app / root component is rendered into document.body it also set's up onKeyDown onKeyUp to handle application keyboard shortcuts.

The problem I'm running into is that some user interaction like clicking around page causes document.body to obtain focus (to become document.activeElement) and in that case onKeyDown & onKeyUp event handlers are no longer invoked.

I know I could register "keydown", "keyup" event handlers manually once app component is mounted but I would prefer to stay with-in react.

@syranide
Copy link
Contributor

I'd call this a duplicate of #285, re-open if you disagree.

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