focus-lock
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -11,2 +11,4 @@ 'use strict'; | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
var filterNested = function filterNested(nodes) { | ||
@@ -43,3 +45,3 @@ var l = nodes.length; | ||
if (group) { | ||
return filterNested(Array.from(getTopParent(node).querySelectorAll('[' + _constants.FOCUS_GROUP + '="' + group + '"]:not([' + _constants.FOCUS_DISABLED + '="disabled"])'))); | ||
return filterNested([].concat(_toConsumableArray(getTopParent(node).querySelectorAll('[' + _constants.FOCUS_GROUP + '="' + group + '"]:not([' + _constants.FOCUS_DISABLED + '="disabled"])')))); | ||
} | ||
@@ -46,0 +48,0 @@ return [node]; |
{ | ||
"name": "focus-lock", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "DOM trap for a focus", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -16,3 +16,3 @@ # focus-lock | ||
#WHY? | ||
# WHY? | ||
From [MDN Article about accessible dialogs](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_dialog_role): | ||
@@ -26,3 +26,3 @@ - The dialog must be properly labeled | ||
#Implementations | ||
# Implementations | ||
@@ -32,2 +32,3 @@ This is vanilla js base package for: | ||
- [vue-focus-lock](https://github.com/theKashey/vue-focus-lock) | ||
- [dom-focus-lock](https://github.com/theKashey/dom-focus-lock) | ||
@@ -39,3 +40,3 @@ | ||
#API | ||
# API | ||
@@ -42,0 +43,0 @@ `default(topNode, lastNode)` (aka setFocus), moves focus inside topNode, keeping in mind that last focus inside was - lastNode |
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
135418
378
45