@github/hotkey
Advanced tools
Comparing version 1.5.3 to 1.5.4
@@ -132,15 +132,15 @@ class Leaf { | ||
if (newTriePosition instanceof Leaf) { | ||
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; | ||
const target = event.target; | ||
let shouldFire = false; | ||
let elementToFire; | ||
const formField = isFormField(target); | ||
for (let i = newTriePosition.children.length - 1; i >= 0; i -= 1) { | ||
elementToFire = newTriePosition.children[i]; | ||
const scope = elementToFire.getAttribute('data-hotkey-scope'); | ||
if ((!formField && !scope) || (formField && target.id === scope)) { | ||
shouldFire = true; | ||
break; | ||
} | ||
} | ||
else if (hotkeyScope) { | ||
shouldFire = false; | ||
} | ||
if (shouldFire) { | ||
if (elementToFire && shouldFire) { | ||
fireDeterminedAction(elementToFire); | ||
@@ -147,0 +147,0 @@ event.preventDefault(); |
{ | ||
"name": "@github/hotkey", | ||
"version": "1.5.3", | ||
"version": "1.5.4", | ||
"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
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
15148