-
Notifications
You must be signed in to change notification settings - Fork 47.9k
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
Keyboard events dont fire unless you are focussed on a form input #1795
Comments
Yes, that's how key events work in JS – what you want is to bind to key events on window, which we don't currently have a way to do. Closing as a dupe of #285. |
If you want to do this sort of thing the Wiki -> Complementary tools links to https://github.com/jhudson8/react-events which will be able to more easily bind to window keypress events in the class context you expect |
@spicyj thanks for the quick reply. |
@bakesteve Setting |
eh - I was SURE I tried that! |
When binding to KeyUp, events only fire if a form input has focus
That prevents various scenarios, like keyboard navigation of a list / grid, and also things like keyboard shortcuts.
Fiddle to demo this is:
http://jsfiddle.net/JXwWC/
I can understand there may be performance reasons for this, and couldnt see the code that caused this, but be great if this can change (and happy to submit a PR if someone points out where the choice to only bind if focussed is happening
The text was updated successfully, but these errors were encountered: