Socket
Socket
Sign inDemoInstall

react-hotkeys-hook

Package Overview
Dependencies
Maintainers
1
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hotkeys-hook - npm Package Compare versions

Comparing version 4.0.0-3 to 4.0.0-4

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc