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

Feature: Add support for event capturing #1214

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ollieri3
Copy link

@ollieri3 ollieri3 commented Oct 1, 2024

This small change adds a new capture option to the useHotkeys hook. It determines whether key events will be triggered in the capturing or bubbling phase (default) during event propogation. More info here.

I've found this to be useful when setting up global hotkeys within an application where you may wish to override any child elements that stopPropagation().


I've added a test to verify this new behaviour along with documentation of the new option, please let me know If you'd like me to make any further changes.

Thanks for this awesome library.

Copy link

vercel bot commented Oct 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-hotkeys-hook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 1, 2024 10:04am

@JohannesKlauss
Copy link
Owner

@ollieri3 First of all sorry for the long wait! Second: Thank you so much for your contribution, it's an interesting new feature. Could you add info to the documentation pages as well? And I think you need to update your branch to reflect the latest changes on the main branch, then I'll merge it.

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

Successfully merging this pull request may close these issues.

2 participants