@github/hotkey
Advanced tools
Comparing version 1.4.4 to 1.5.0
@@ -112,4 +112,11 @@ class Leaf { | ||
return; | ||
if (event.target instanceof Node && isFormField(event.target)) | ||
if (!(event.target instanceof Node)) | ||
return; | ||
if (isFormField(event.target)) { | ||
const target = event.target; | ||
if (!target.id) | ||
return; | ||
if (!target.ownerDocument.querySelector(`[data-hotkey-scope=${target.id}]`)) | ||
return; | ||
} | ||
if (resetTriePositionTimer != null) { | ||
@@ -126,6 +133,19 @@ window.clearTimeout(resetTriePositionTimer); | ||
if (newTriePosition instanceof Leaf) { | ||
fireDeterminedAction(newTriePosition.children[newTriePosition.children.length - 1]); | ||
event.preventDefault(); | ||
let shouldFire = true; | ||
const elementToFire = newTriePosition.children[newTriePosition.children.length - 1]; | ||
const hotkeyScope = elementToFire.getAttribute('data-hotkey-scope'); | ||
if (isFormField(event.target)) { | ||
const target = event.target; | ||
if (target.id !== elementToFire.getAttribute('data-hotkey-scope')) { | ||
shouldFire = false; | ||
} | ||
} | ||
else if (hotkeyScope) { | ||
shouldFire = false; | ||
} | ||
if (shouldFire) { | ||
fireDeterminedAction(elementToFire); | ||
event.preventDefault(); | ||
} | ||
resetTriePosition(); | ||
return; | ||
} | ||
@@ -132,0 +152,0 @@ } |
{ | ||
"name": "@github/hotkey", | ||
"version": "1.4.4", | ||
"version": "1.5.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
15116
290
1
1