@vaadin/a11y-base 24.1.5 → 24.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/aria-hidden.js +16 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/a11y-base",
|
|
3
|
-
"version": "24.1.
|
|
3
|
+
"version": "24.1.7",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
34
34
|
"@polymer/polymer": "^3.0.0",
|
|
35
|
-
"@vaadin/component-base": "~24.1.
|
|
35
|
+
"@vaadin/component-base": "~24.1.7",
|
|
36
36
|
"lit": "^2.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"@vaadin/testing-helpers": "^0.4.2",
|
|
41
41
|
"sinon": "^13.0.2"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "0cd1fe7a6d944a9c91bab2b83f73cba0e7b1b1c4"
|
|
44
44
|
}
|
package/src/aria-hidden.js
CHANGED
|
@@ -23,12 +23,6 @@ let markerMap = {};
|
|
|
23
23
|
/** @type {number} */
|
|
24
24
|
let lockCount = 0;
|
|
25
25
|
|
|
26
|
-
/**
|
|
27
|
-
* @param {Element | Shadow} node
|
|
28
|
-
* @return {Element | null}
|
|
29
|
-
*/
|
|
30
|
-
const unwrapHost = (node) => (node ? node.host || unwrapHost(node.parentNode) : null);
|
|
31
|
-
|
|
32
26
|
/**
|
|
33
27
|
* @param {?Node} node
|
|
34
28
|
* @return {boolean}
|
|
@@ -60,13 +54,12 @@ const correctTargets = (parent, targets) => {
|
|
|
60
54
|
return null;
|
|
61
55
|
}
|
|
62
56
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return correctedTarget;
|
|
57
|
+
let node = target;
|
|
58
|
+
while (node && node !== parent) {
|
|
59
|
+
if (parent.contains(node)) {
|
|
60
|
+
return target;
|
|
61
|
+
}
|
|
62
|
+
node = node.getRootNode().host;
|
|
70
63
|
}
|
|
71
64
|
|
|
72
65
|
logError(target, 'is not contained inside', parent);
|
|
@@ -110,7 +103,13 @@ const applyAttributeToOthers = (originalTarget, parentNode, markerName, controlA
|
|
|
110
103
|
}
|
|
111
104
|
|
|
112
105
|
elementsToKeep.add(el);
|
|
113
|
-
|
|
106
|
+
|
|
107
|
+
const slot = el.assignedSlot;
|
|
108
|
+
if (slot) {
|
|
109
|
+
keep(slot);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
keep(el.parentNode || el.host);
|
|
114
113
|
};
|
|
115
114
|
|
|
116
115
|
targets.forEach(keep);
|
|
@@ -123,7 +122,9 @@ const applyAttributeToOthers = (originalTarget, parentNode, markerName, controlA
|
|
|
123
122
|
return;
|
|
124
123
|
}
|
|
125
124
|
|
|
126
|
-
|
|
125
|
+
const root = parent.shadowRoot;
|
|
126
|
+
const children = root ? [...parent.children, ...root.children] : [...parent.children];
|
|
127
|
+
children.forEach((node) => {
|
|
127
128
|
// Skip elements that don't need to be hidden
|
|
128
129
|
if (['template', 'script', 'style'].includes(node.localName)) {
|
|
129
130
|
return;
|