@zag-js/aria-hidden
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -31,3 +31,2 @@ "use strict"; | ||
function ariaHidden(targets, rootEl) { | ||
var _a; | ||
const exclude = targets.filter(Boolean); | ||
@@ -37,6 +36,6 @@ if (exclude.length === 0) | ||
const doc = exclude[0].ownerDocument || document; | ||
const win = (_a = doc.defaultView) != null ? _a : window; | ||
const win = doc.defaultView ?? window; | ||
const visibleNodes = new Set(exclude); | ||
const hiddenNodes = /* @__PURE__ */ new Set(); | ||
const root = rootEl != null ? rootEl : doc.body; | ||
const root = rootEl ?? doc.body; | ||
const walker = doc.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, { | ||
@@ -60,4 +59,3 @@ acceptNode(node2) { | ||
const hide = (node2) => { | ||
var _a2; | ||
let refCount = (_a2 = elementCountMap.get(node2)) != null ? _a2 : 0; | ||
let refCount = elementCountMap.get(node2) ?? 0; | ||
if (node2.getAttribute("aria-hidden") === "true" && refCount === 0) { | ||
@@ -64,0 +62,0 @@ return; |
{ | ||
"name": "@zag-js/aria-hidden", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Hide targets from screen readers", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
8966
188