Socket
Socket
Sign inDemoInstall

focus-lock

Package Overview
Dependencies
1
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.0 to 1.3.1

11

dist/es2015/solver.js

@@ -44,4 +44,2 @@ import { correctNodes } from './utils/correctFocus';

var correctedIndexDiff = correctedIndex - (lastNode ? correctedNodes.indexOf(lastNode) : activeIndex);
var returnFirstNode = pickFocusable(innerNodes, innerTabbables[0]);
var returnLastNode = pickFocusable(innerNodes, innerTabbables[innerTabbables.length - 1]);
// old focus

@@ -51,2 +49,11 @@ if (!indexDiff && lastNodeInside >= 0) {

}
// no tabbable elements, autofocus is not possible
if (innerTabbables.length === 0) {
// an edge case with no tabbable elements
// return the last focusable one
// with some probability this will prevent focus from cycling across the lock, but there is no tabbale elements to cycle to
return lastNodeInside;
}
var returnFirstNode = pickFocusable(innerNodes, innerTabbables[0]);
var returnLastNode = pickFocusable(innerNodes, innerTabbables[innerTabbables.length - 1]);
// first element

@@ -53,0 +60,0 @@ if (activeIndex <= firstNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) {

@@ -44,4 +44,2 @@ import { correctNodes } from './utils/correctFocus';

const correctedIndexDiff = correctedIndex - (lastNode ? correctedNodes.indexOf(lastNode) : activeIndex);
const returnFirstNode = pickFocusable(innerNodes, innerTabbables[0]);
const returnLastNode = pickFocusable(innerNodes, innerTabbables[innerTabbables.length - 1]);
// old focus

@@ -51,2 +49,11 @@ if (!indexDiff && lastNodeInside >= 0) {

}
// no tabbable elements, autofocus is not possible
if (innerTabbables.length === 0) {
// an edge case with no tabbable elements
// return the last focusable one
// with some probability this will prevent focus from cycling across the lock, but there is no tabbale elements to cycle to
return lastNodeInside;
}
const returnFirstNode = pickFocusable(innerNodes, innerTabbables[0]);
const returnLastNode = pickFocusable(innerNodes, innerTabbables[innerTabbables.length - 1]);
// first element

@@ -53,0 +60,0 @@ if (activeIndex <= firstNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) {

@@ -47,4 +47,2 @@ "use strict";

var correctedIndexDiff = correctedIndex - (lastNode ? correctedNodes.indexOf(lastNode) : activeIndex);
var returnFirstNode = (0, firstFocus_1.pickFocusable)(innerNodes, innerTabbables[0]);
var returnLastNode = (0, firstFocus_1.pickFocusable)(innerNodes, innerTabbables[innerTabbables.length - 1]);
// old focus

@@ -54,2 +52,11 @@ if (!indexDiff && lastNodeInside >= 0) {

}
// no tabbable elements, autofocus is not possible
if (innerTabbables.length === 0) {
// an edge case with no tabbable elements
// return the last focusable one
// with some probability this will prevent focus from cycling across the lock, but there is no tabbale elements to cycle to
return lastNodeInside;
}
var returnFirstNode = (0, firstFocus_1.pickFocusable)(innerNodes, innerTabbables[0]);
var returnLastNode = (0, firstFocus_1.pickFocusable)(innerNodes, innerTabbables[innerTabbables.length - 1]);
// first element

@@ -56,0 +63,0 @@ if (activeIndex <= firstNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) {

2

package.json
{
"name": "focus-lock",
"version": "1.3.0",
"version": "1.3.1",
"description": "DOM trap for a focus",

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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc