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

tabbable

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tabbable - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

4

CHANGELOG.md
# Changelog
## 1.0.8
- Allows operation against elements that reside within iframes, by inspecting the element to determine its correct parent `document` (rather than relying on the global `document` object).
## 1.0.7

@@ -4,0 +8,0 @@

15

index.js
module.exports = function(el) {
var elementDocument = el.ownerDocument;
var basicTabbables = [];

@@ -7,3 +8,3 @@ var orderedTabbables = [];

// - it's computed style
var isUnavailable = createIsUnavailable();
var isUnavailable = createIsUnavailable(elementDocument);

@@ -30,3 +31,3 @@ var candidateSelectors = [

|| candidate.disabled
|| isUnavailable(candidate)
|| isUnavailable(candidate, elementDocument)
) {

@@ -60,3 +61,3 @@ continue;

function createIsUnavailable() {
function createIsUnavailable(elementDocument) {
// Node cache must be refreshed on every check, in case

@@ -72,3 +73,3 @@ // the content of the element has changed

function isOff(node, nodeComputedStyle) {
if (node === document.documentElement) return false;
if (node === elementDocument.documentElement) return false;

@@ -80,3 +81,3 @@ // Find the cached node (Array.prototype.find not available in IE9)

nodeComputedStyle = nodeComputedStyle || window.getComputedStyle(node);
nodeComputedStyle = nodeComputedStyle || elementDocument.defaultView.getComputedStyle(node);

@@ -97,5 +98,5 @@ var result = false;

return function isUnavailable(node) {
if (node === document.documentElement) return false;
if (node === elementDocument.documentElement) return false;
var computedStyle = window.getComputedStyle(node);
var computedStyle = elementDocument.defaultView.getComputedStyle(node);

@@ -102,0 +103,0 @@ if (isOff(node, computedStyle)) return true;

{
"name": "tabbable",
"version": "1.0.7",
"version": "1.0.8",
"description": "Returns an array of all tabbable DOM nodes within a containing node.",

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

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