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

Allowing events to bubble #52

Closed
Aryk opened this issue Jan 15, 2017 · 2 comments
Closed

Allowing events to bubble #52

Aryk opened this issue Jan 15, 2017 · 2 comments
Milestone

Comments

@Aryk
Copy link

Aryk commented Jan 15, 2017

A single key sequence could be handled by "in focus" multiple components however in most use cases it does not make much sense for a parent to handle the same hotkey if a child has already dealt with it. For this reason hotkey events will not propagate beyond the component which handles them by default.

So how can we override this default?

@ruanyl
Copy link

ruanyl commented Jan 27, 2017

@Aryk I had the same issue here. However, it is impossible to override this. react-hotkeys internally avoid to call the handler on a parent component if a child component has the same handler(key sequence) defined.

Here I have a workaround react-keyboard which is on top of react-hotkeys but without the propagation magic

It's just a simple wrap of mousetrap, and follows the rule of event propagation of mousetrap. It works fine in my project so far. Maybe you could take a look.

@Aryk
Copy link
Author

Aryk commented Jan 28, 2017

Thanks for the suggestion, will have a look!

@chrisui chrisui mentioned this issue Feb 3, 2017
8 tasks
@greena13 greena13 added this to the v1.0.0 milestone Nov 19, 2017
@greena13 greena13 closed this as completed Jan 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants