react-hotkeys-hook
Advanced tools
Comparing version 4.0.0-3 to 4.0.0-4
{ | ||
"name": "react-hotkeys-hook", | ||
"version": "4.0.0-3", | ||
"version": "4.0.0-4", | ||
"repository": "https://JohannesKlauss@github.com/JohannesKlauss/react-keymap-hook.git", | ||
@@ -5,0 +5,0 @@ "homepage": "https://johannesklauss.github.io/react-hotkeys-hook/", |
@@ -17,3 +17,4 @@ import { Hotkey, KeyboardModifiers, Keys } from './types' | ||
.split(combinationKey) | ||
.map((k) => k.trim()) | ||
.map(k => k.trim()) | ||
.map(k => k === 'esc' ? 'escape' : k) | ||
@@ -20,0 +21,0 @@ const modifiers: KeyboardModifiers = { |
@@ -50,3 +50,3 @@ import { HotkeyCallback, Keys, OptionsOrDependencyArray, RefType } from './types' | ||
// TODO: SINCE THE EVENT IS NOW ATTACHED TO THE REF THE ACTIVE ELEMENT CAN NEVER BE INSIDE THE REF. THE HOTKEY ONLY TRIGGERS IF THE | ||
// TODO: SINCE THE EVENT IS NOW ATTACHED TO THE REF, THE ACTIVE ELEMENT CAN NEVER BE INSIDE THE REF. THE HOTKEY ONLY TRIGGERS IF THE | ||
// REF IS THE ACTIVE ELEMENT. THIS IS A PROBLEM SINCE FOCUSED SUB COMPONENTS WONT TRIGGER THE HOTKEY. | ||
@@ -90,3 +90,8 @@ | ||
const handleKeyUp = (event: KeyboardEvent) => { | ||
pressedDownKeys.delete(event.key.toLowerCase()) | ||
if (event.key.toLowerCase() !== 'meta') { | ||
pressedDownKeys.delete(event.key.toLowerCase()) | ||
} else { | ||
// On macOS pressing down the meta key prevents triggering the keyup event for any other key https://stackoverflow.com/a/57153300/735226. | ||
pressedDownKeys.clear() | ||
} | ||
@@ -93,0 +98,0 @@ if (memoisedOptions?.keyup) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
803816
766