@zag-js/aria-hidden
Advanced tools
Comparing version 0.82.1 to 0.82.2
@@ -25,3 +25,3 @@ 'use strict'; | ||
var walkTreeOutside = (originalTarget, props) => { | ||
const { parentNode, markerName, controlAttribute } = props; | ||
const { parentNode, markerName, controlAttribute, explicitBooleanValue } = props; | ||
const targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]); | ||
@@ -50,3 +50,3 @@ markerMap[markerName] || (markerMap[markerName] = /* @__PURE__ */ new WeakMap()); | ||
const attr = node.getAttribute(controlAttribute); | ||
const alreadyHidden = attr !== null && attr !== "false"; | ||
const alreadyHidden = explicitBooleanValue ? attr === "true" : attr !== null && attr !== "false"; | ||
const counterValue = (counterMap.get(node) || 0) + 1; | ||
@@ -64,3 +64,3 @@ const markerValue = (markerCounter.get(node) || 0) + 1; | ||
if (!alreadyHidden) { | ||
node.setAttribute(controlAttribute, ""); | ||
node.setAttribute(controlAttribute, explicitBooleanValue ? "true" : ""); | ||
} | ||
@@ -112,3 +112,4 @@ } catch (e) { | ||
markerName, | ||
controlAttribute: "aria-hidden" | ||
controlAttribute: "aria-hidden", | ||
explicitBooleanValue: true | ||
}); | ||
@@ -115,0 +116,0 @@ }; |
{ | ||
"name": "@zag-js/aria-hidden", | ||
"version": "0.82.1", | ||
"version": "0.82.2", | ||
"description": "Hide targets from screen readers", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
12507
271