-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fix(useMagicKeys): doesn't trigger on releasing and pressing again the second key in a combination #4691
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
base: main
Are you sure you want to change the base?
Conversation
…ssing again the second key in a combination
const key = e.key?.toLowerCase() | ||
// #3026: doesn't trigger on releasing and pressing again the second key in a combination | ||
// Solution: Trigger "keyup" event manually when "keydown" event is fired without "keyup" | ||
if (key && e.getModifierState('Meta') && current.has(key)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it this a meta key only problem? what about shift and ctrl?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OrbisK Yes it's only a meta key problem. Shift and ctrl don't have any issues on Mac
More info:
https://stackoverflow.com/questions/25438608/javascript-keyup-isnt-called-when-command-and-another-is-pressed
https://blog.bitsrc.io/keyup-event-and-cmd-problem-88f4038c5ed2
@OrbisK Anything else needed for this to be merged? |
Closing because I found a bug with this approach when holding cmd+z |
@OrbisK Reopening because supporting key repeats is out of scope for |
@OrbisK Everything is working, and all tests are passing. Is there anything I can do to help get this approved? |
Before submitting the PR, please make sure you do the following
fixes #123
).Description
Fixes #3026
Additional context
This is the explanation of the issue and the solution