Socket
Socket
Sign inDemoInstall

focus-lock

Package Overview
Dependencies
0
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.3 to 0.0.4

7

dist/focusMerge.js

@@ -15,3 +15,3 @@ 'use strict';

var findAutoFocused = function findAutoFocused(node) {
return !!node.autofocus;
return !!node.autofocus || !!node.dataset.autofocus;
};

@@ -24,2 +24,7 @@

// focus is inside
if (innerNodes.indexOf(activeElement) >= 0) {
return undefined;
}
var activeIndex = outerNodes.indexOf(activeElement);

@@ -26,0 +31,0 @@ var lastIndex = outerNodes.indexOf(lastNode || activeIndex);

2

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

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

@@ -5,3 +5,3 @@ import { orderByTabIndex } from './utils/tabOrder';

const findAutoFocused = node => !!node.autofocus;
const findAutoFocused = node => !!node.autofocus || !!node.dataset.autofocus;

@@ -13,2 +13,7 @@ export const newFocus = (innerNodes, outerNodes, activeElement, lastNode, autoFocused) => {

// focus is inside
if (innerNodes.indexOf(activeElement) >= 0) {
return undefined;
}
const activeIndex = outerNodes.indexOf(activeElement);

@@ -15,0 +20,0 @@ const lastIndex = outerNodes.indexOf(lastNode || activeIndex);

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