Socket
Socket
Sign inDemoInstall

@github/hotkey

Package Overview
Dependencies
Maintainers
15
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@github/hotkey - npm Package Compare versions

Comparing version 1.2.4 to 1.3.0

13

dist/index.esm.js

@@ -164,17 +164,6 @@ function _classCallCheck(instance, Constructor) {

}
function isActivableFormField(element) {
if (!(element instanceof HTMLElement)) {
return false;
}
var name = element.nodeName.toLowerCase();
var type = (element.getAttribute('type') || '').toLowerCase();
return name === 'input' && (type === 'checkbox' || type === 'radio');
}
function fireDeterminedAction(el) {
if (isFormField(el)) {
el.focus();
} else if (el instanceof HTMLAnchorElement && el.href || el.tagName === 'BUTTON' || el.tagName === 'SUMMARY' || isActivableFormField(el)) {
} else {
el.click();

@@ -181,0 +170,0 @@ }

@@ -170,17 +170,6 @@ (function (global, factory) {

}
function isActivableFormField(element) {
if (!(element instanceof HTMLElement)) {
return false;
}
var name = element.nodeName.toLowerCase();
var type = (element.getAttribute('type') || '').toLowerCase();
return name === 'input' && (type === 'checkbox' || type === 'radio');
}
function fireDeterminedAction(el) {
if (isFormField(el)) {
el.focus();
} else if (el instanceof HTMLAnchorElement && el.href || el.tagName === 'BUTTON' || el.tagName === 'SUMMARY' || isActivableFormField(el)) {
} else {
el.click();

@@ -187,0 +176,0 @@ }

2

package.json
{
"name": "@github/hotkey",
"version": "1.2.4",
"version": "1.3.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.umd.js",

@@ -5,3 +5,3 @@ # Hotkey Behavior

on the keyboard. This triggers a focus event on form fields, or a click event on
`<a href="...">`, `<button>` and `<summary>` elements.
others.

@@ -33,2 +33,4 @@ By default, hotkeys are extracted from a target element's `data-hotkey`

### Character Key Shortcuts
Please note that adding this functionality to your site can be a drawback for

@@ -42,2 +44,6 @@ certain users. Providing a way in your system to disable hotkeys or remap

### Interactive Elements
Wherever possible, hotkeys should be add to [interactive and focusable elements](https://html.spec.whatwg.org/#interactive-content). If a static element must be used, please follow the guideline in ["Adding keyboard-accessible actions to static HTML elements"](https://www.w3.org/WAI/WCAG21/Techniques/client-side-script/SCR29.html).
## Installation

@@ -44,0 +50,0 @@

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