Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arrow-key-navigation

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arrow-key-navigation - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

14

dist-node/index.js

@@ -11,5 +11,10 @@ 'use strict';

/* global document, addEventListener, removeEventListener, getSelection */
// this query is adapted from via a11y-dialog
var focusablesQuery = 'a[href], area[href], input, select, textarea, ' + 'button, iframe, object, embed, [contenteditable], [tabindex], video[controls], audio[controls]';
var textInputTypes = ['text', 'search', 'number', 'email', 'url'];
// This query is adapted from a11y-dialog
// https://github.com/edenspiekermann/a11y-dialog/blob/cf4ed81/a11y-dialog.js#L6-L18
var focusablesQuery = 'a[href], area[href], input, select, textarea, ' + 'button, iframe, object, embed, [contenteditable], [tabindex], video[controls], audio[controls]'; // TODO: email/number types are a special type, in that they return selectionStart/selectionEnd as null
// As far as I can tell, there is no way to actually get the caret position from these inputs. So we
// don't do the proper caret handling for those inputs, unfortunately.
// https://html.spec.whatwg.org/multipage/input.html#do-not-apply
var textInputTypes = ['text', 'search', 'url', 'password', 'tel'];
var checkboxRadioInputTypes = ['checkbox', 'radio'];

@@ -29,3 +34,4 @@ var focusTrapTest = undefined;

if (element === activeElement || !element.disabled && !/^-/.test(element.getAttribute('tabindex') || '') && (element.offsetWidth > 0 || element.offsetHeight > 0)) {
if (element === activeElement || !element.disabled && !/^-/.test(element.getAttribute('tabindex') || '') && !element.hasAttribute('inert') && ( // see https://github.com/GoogleChrome/inert-polyfill
element.offsetWidth > 0 || element.offsetHeight > 0)) {
res.push(element);

@@ -32,0 +38,0 @@ }

@@ -6,6 +6,11 @@ /**

/* global document, addEventListener, removeEventListener, getSelection */
// this query is adapted from via a11y-dialog
// This query is adapted from a11y-dialog
// https://github.com/edenspiekermann/a11y-dialog/blob/cf4ed81/a11y-dialog.js#L6-L18
var focusablesQuery = 'a[href], area[href], input, select, textarea, ' +
'button, iframe, object, embed, [contenteditable], [tabindex], video[controls], audio[controls]';
var textInputTypes = ['text', 'search', 'number', 'email', 'url'];
// TODO: email/number types are a special type, in that they return selectionStart/selectionEnd as null
// As far as I can tell, there is no way to actually get the caret position from these inputs. So we
// don't do the proper caret handling for those inputs, unfortunately.
// https://html.spec.whatwg.org/multipage/input.html#do-not-apply
var textInputTypes = ['text', 'search', 'url', 'password', 'tel'];
var checkboxRadioInputTypes = ['checkbox', 'radio'];

@@ -22,3 +27,5 @@ var focusTrapTest = undefined;

var element = elements[i];
if (element === activeElement || (!element.disabled && !/^-/.test(element.getAttribute('tabindex') || '') &&
if (element === activeElement || (!element.disabled &&
!/^-/.test(element.getAttribute('tabindex') || '') &&
!element.hasAttribute('inert') && // see https://github.com/GoogleChrome/inert-polyfill
(element.offsetWidth > 0 || element.offsetHeight > 0))) {

@@ -25,0 +32,0 @@ res.push(element);

@@ -6,6 +6,11 @@ /**

/* global document, addEventListener, removeEventListener, getSelection */
// this query is adapted from via a11y-dialog
// This query is adapted from a11y-dialog
// https://github.com/edenspiekermann/a11y-dialog/blob/cf4ed81/a11y-dialog.js#L6-L18
var focusablesQuery = 'a[href], area[href], input, select, textarea, ' +
'button, iframe, object, embed, [contenteditable], [tabindex], video[controls], audio[controls]';
var textInputTypes = ['text', 'search', 'number', 'email', 'url'];
// TODO: email/number types are a special type, in that they return selectionStart/selectionEnd as null
// As far as I can tell, there is no way to actually get the caret position from these inputs. So we
// don't do the proper caret handling for those inputs, unfortunately.
// https://html.spec.whatwg.org/multipage/input.html#do-not-apply
var textInputTypes = ['text', 'search', 'url', 'password', 'tel'];
var checkboxRadioInputTypes = ['checkbox', 'radio'];

@@ -22,3 +27,5 @@ var focusTrapTest = undefined;

var element = elements[i];
if (element === activeElement || (!element.disabled && !/^-/.test(element.getAttribute('tabindex') || '') &&
if (element === activeElement || (!element.disabled &&
!/^-/.test(element.getAttribute('tabindex') || '') &&
!element.hasAttribute('inert') && // see https://github.com/GoogleChrome/inert-polyfill
(element.offsetWidth > 0 || element.offsetHeight > 0))) {

@@ -25,0 +32,0 @@ res.push(element);

{
"name": "arrow-key-navigation",
"description": "Add left/right key navigation to a KaiOS app or web app",
"version": "1.0.1",
"version": "1.0.2",
"license": "Apache-2.0",

@@ -6,0 +6,0 @@ "files": [

Sorry, the diff of this file is not supported yet

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