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

Clear _downKeys on dispatch #122

Closed
wants to merge 1 commit into from

Conversation

stevenlundy
Copy link

This is a possible solution to the issue I filed at jaywcjlove/react-hotkeys#29

This change starts from an empty _downKeys array in case a key wasn't cleared (e.g. no key up is fired on mac for cmd+up)

It will work given:

  • Only key combos with modifiers and up to one key are supported by this library
  • The dispatch function rebuilds _downKeys to include correct modifiers

There are other changes that could be made given that we start from an empty _downKeys array, but this seemed like a good start and doesn't break any tests.

Only key combos with modifiers and up to one key are supported
The dispatch function rebuilds _downKeys to include correct modifiers
This change starts from an empty _downKeys array in case a key
wasn't cleared (e.g. no key up is fired on mac for cmd+up)
@coveralls
Copy link

Pull Request Test Coverage Report for Build 209

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 81.179%

Totals Coverage Status
Change from base Build 208: -0.2%
Covered Lines: 194
Relevant Lines: 208

💛 - Coveralls

@codecov-io
Copy link

Codecov Report

Merging #122 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #122      +/-   ##
==========================================
+ Coverage   93.23%   93.26%   +0.03%     
==========================================
  Files           1        1              
  Lines         207      208       +1     
==========================================
+ Hits          193      194       +1     
  Misses         14       14
Impacted Files Coverage Δ
dist/hotkeys.js 93.26% <100%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f362846...9e64917. Read the comment docs.

@jaywcjlove
Copy link
Owner

@stevenlundy I tested it and it didn't solve the problem, which caused some functions to fail.

@jaywcjlove jaywcjlove closed this Mar 25, 2020
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.

4 participants