focus-lock
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -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); |
{ | ||
"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); |
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
137693
540