-
Notifications
You must be signed in to change notification settings - Fork 160
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
Allow HotKeys component to autofocus #41
Comments
+1. See also #25, and in particular this comment |
Hey man cheers for the request! I definitely want to make it easier for global hotkeys as it seems it's quite a popular request and not obvious how to do it. I'm wondering whether Theoretically this should be possible on Just to check could you, on your global top level <Hotkeys focused={true} attach={window} ... /> This is a work around if it works and I will look to make it easier (and document!!) for global hotkeys. My proposal would be for a prop |
Yup it works perfectly, thanks! |
BTW, what if I have some local hotkeys within the global hotkeys scope? will it fire event for both hotkey maps? edit: I do understand that the best way would be not to design ambiguous hotkeys, I'm just curious |
Theoretically if the local scope is focused and the exact same hotkey sequence is triggered the local one will take precedence. Ive been toying with the idea of allowing you to say "I actually don't want to handle this so pass it on" inside the handler via some "continuePropagation" api but for now you can at least just call props upwards yourself. |
That's not my case, actually I'm glad one action cancels out another. Is |
Yup I implemented that believing it's the most sensible default! :) it's That api will definitely be supported for the foreseeable future as an On 27 Aug 2016 17:08, "Filip" notifications@github.com wrote:
|
Hi, where I can find list of all attributes like |
Hi rajnishcoder, You can take a look at the TypeScript definitions for the Or for the new pre-release, take a look at the HotKeys API documentation - in this and all future versions, |
I'd like to be able to have HotKeys autofocus, so I can easily set up global hotkeys.
Proposal: when given an
autoFocus
prop, HotKeys would render FocusTrap withref={n => n && setTimeout(() => n.focus())}
.The text was updated successfully, but these errors were encountered: