-
Notifications
You must be signed in to change notification settings - Fork 118
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
Ability to scope to elements #273
Comments
I am not quite sure if I understand what the benefit would be there. What does the ref gain? |
Could it be scope down to specific Element ? If i focus that box, i move that box by using left/right Example : |
Take a look at this library: https://github.com/greena13/react-hotkeys Imagine the following scenario: User has multiple tree components on a page. When a user focuses one of them, I want them to be able to expand all the nodes on the tree w/ a keyboard shortcut but only the one they have in focus. Other scenarios might involve binding specific hotkeys to an input for autocomplete features, etc. |
I think I am seeing a similar issue as @amcdnl is. When I use hotkeys hook in one component, the hook callback is fired even if another component is focused. Please, take a look at an example here and let me know if this behaviour is expected, more details included there Thanks! |
My computer broke down few weeks ago, so i don't have the possibility to dig into this, although this might be related to #276 |
@frycz The enabled tags are a global setting in the underlying hotkeys.js package as issued in #276. Only viable solution would be to create a custom implementation, but I don't have the time for that. Also the scope itself is set global, so this is the reason why the hotkeys aren't scoped to the component it is used in. When creating this library I just needed a quick wrapper around a hotkeys package for some functionality and didn't think much about other use cases. |
@JohannesKlauss, Yea, we already have implemented a custom solution. Thanks for your answer anyway, cheers |
@frycz - mind sharing? |
No problem. After analyzing our needs we realized that our case is so simple that we don't need any external libraries nor generic solutions. We just added a |
@amcdnl just to give an update on this, i am currently investigating on this feature as well as the ability to get all hotkeys. |
Using |
Hi @JohannesKlauss , It's should be 2.2.0 instead of 2.3.0 right? |
@Taymindis Yes, of course. my bad. |
It would be nice if it had to ability to scope based on a ref. Example:
The text was updated successfully, but these errors were encountered: