Open pau-not-paul opened 4 years ago
The workaround doesn't seem to work for scenarios in which one is trying to capture both 'command+z' and 'command+shift+z':
Log
HotKeys (GLOBAL-E21๐): New 'Meta' keydown event (that has NOT passed through React app).
HotKeys (GLOBAL-E21๐): Added 'Meta' to current combination: 'Meta'.
HotKeys (GLOBAL-E21๐): Attempting to find action matching 'Meta' keydown . . .
HotKeys (GLOBAL-E21๐-C0๐บ): No matching actions found for 'Meta' keydown.
HotKeys (GLOBAL-E22๐): New (simulated) 'Meta' keypress event (that has NOT passed through React app).
HotKeys (GLOBAL-E22๐): Ignored 'Meta' keypress because it doesn't have any keypress handlers.
HotKeys (GLOBAL-E23๐งก): New 'z' keydown event (that has NOT passed through React app).
HotKeys (GLOBAL-E23๐งก): Added 'z' to current combination: 'Meta+z'.
HotKeys (GLOBAL-E23๐งก): Attempting to find action matching 'Meta+z' keydown . . .
HotKeys (GLOBAL-E23๐งก-C0๐บ): Found action that matches 'Meta+z': UNDO. Calling handler . . .
HotKeys (GLOBAL-E23๐งก-C0๐บ): Stopping further event propagation.
HotKeys (GLOBAL-E23๐งก): Searching no further, as handler has been found (and called).
// z released
HotKeys (GLOBAL-E24โค๏ธ): New (simulated) 'z' keypress event (that has NOT passed through React app).
HotKeys (GLOBAL-E24โค๏ธ): Ignored 'Meta+z' keypress because it doesn't have any keypress handlers.
// shift pressed
HotKeys (GLOBAL-E25๐): New 'Shift' keydown event (that has NOT passed through React app).
HotKeys (GLOBAL-E25๐): Added 'Shift' to current combination: 'Meta+Shift+z'.
HotKeys (GLOBAL-E25๐): Attempting to find action matching 'Meta+Shift+z' keydown . . .
HotKeys (GLOBAL-E25๐-C0๐บ): Found action that matches 'Meta+Shift+z': REDO. Calling handler . . .
...
Are you guys still having this problem? I was having an issue with nothing working after pressing spacebar and had to refocus the element to restore hotkey functionalities. I was using the package from npm.
I then cloned this repo locally and built it to figure out the issue and realized that the version on github is newer than the one in npm and the issue I was having wasn't present in this one. Maybe this had already been fixed but wasn't published?
I am experiencing the same bug as well. I was experimenting with my very first combinations command+z (undo), command+shit+z(redo) and it resulted exactly is what @mikhuang reported above.
Describe the bug When typing a capital letter using shift (shift+letter), sometimes it registers the keydown event for the upper case letter but then it registers the keyup event for the lower case letter. Since it doesn't have a keyup event for the upper case letter, it thinks that it's still presses
How are you using react hotkeys components? (HotKeys, GlobalHotKeys, IgnoreKeys etc) It happens in all the use cases.
Expected behavior It should detect that the key has been released.
Platform (please complete the following information): It happens with Chrome, Firefox, Safari...
Are you willing and able to create a PR request to fix this issue? No, because I found a workaround:
Include the smallest log that includes your issue:
What Configuration options are you using? It happens with the default config.