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

Dev closing hanging combinations #189

Merged
merged 4 commits into from
Jun 2, 2019
Merged

Conversation

greena13
Copy link
Owner

@greena13 greena13 commented Jun 2, 2019

Context

A recent pull request (#186) switched from observing key combination submatches, to ignoring them by default. This revealed there is an issue (#187) with key events being missed by React HotKeys in circumstances where an action is defined with a handler that changes the React DOM or focused element in such a way that the new focused element is outside of any descendants, resulting in the corresponding keyup event never being logged - and react-hotkeys behaving as if the key is still held down.

One possible (partial) solution to this problem was the addition of a root prop for HotKeys components (#187). This has its advantages of not requiring binding to the document, and remaining relatively self-contained. However, it's limited in its scope and not all users can or want to place a HotKeys component towards the root of their application.

This pull request

Allows GlobalHotKeys components to report any missed key events to HotKeys, and to close any hanging key combinations that arise because an action handler changes focus outside of the HotKeys component before it can register the keypress or keyup event.

@greena13 greena13 merged commit fc83388 into master Jun 2, 2019
@greena13 greena13 deleted the dev_closing_hanging_combinations branch June 2, 2019 18:38
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.

1 participant