@vaadin/a11y-base 24.1.0-alpha7 → 24.1.0-alpha9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/a11y-base",
3
- "version": "24.1.0-alpha7",
3
+ "version": "24.1.0-alpha9",
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.0-alpha7",
35
+ "@vaadin/component-base": "24.1.0-alpha9",
36
36
  "lit": "^2.0.0"
37
37
  },
38
38
  "devDependencies": {
@@ -40,5 +40,5 @@
40
40
  "@vaadin/testing-helpers": "^0.4.0",
41
41
  "sinon": "^13.0.2"
42
42
  },
43
- "gitHead": "6711b6ac7b49e2ddc0990c34de9718b58c2d16b3"
43
+ "gitHead": "db4fe44603a6702b85b0da2a6d033ddf8ffea5c4"
44
44
  }
@@ -114,8 +114,8 @@ export function setAriaIDReference(target, attr, config = { newId: null, oldId:
114
114
  if (!fromUser && !!storedValues) {
115
115
  // If there's any stored values, it means the attribute is being handled by the user
116
116
  // Replace the "oldId" with "newId" on the stored values set and leave
117
- storedValues.delete(oldId);
118
- storedValues.add(newId);
117
+ oldId && storedValues.delete(oldId);
118
+ newId && storedValues.add(newId);
119
119
  return;
120
120
  }
121
121
 
@@ -37,7 +37,11 @@ export class FieldAriaController {
37
37
  setTarget(target) {
38
38
  this.__target = target;
39
39
  this.__setAriaRequiredAttribute(this.__required);
40
- this.__setLabelIdToAriaAttribute(this.__labelId);
40
+ // We need to make sure that value in __labelId is stored
41
+ this.__setLabelIdToAriaAttribute(this.__labelId, this.__labelId);
42
+ if (this.__labelIdFromUser != null) {
43
+ this.__setLabelIdToAriaAttribute(this.__labelIdFromUser, this.__labelIdFromUser, true);
44
+ }
41
45
  this.__setErrorIdToAriaAttribute(this.__errorId);
42
46
  this.__setHelperIdToAriaAttribute(this.__helperId);
43
47
  this.setAriaLabel(this.__label);
@@ -148,7 +148,9 @@ export function isElementHidden(element) {
148
148
  // `offsetParent` is `null` when the element itself
149
149
  // or one of its ancestors is hidden with `display: none`.
150
150
  // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent
151
- if (element.offsetParent === null) {
151
+ // However `offsetParent` is also null when the element is using fixed
152
+ // positioning, so additionally check if the element takes up layout space.
153
+ if (element.offsetParent === null && element.clientWidth === 0 && element.clientHeight === 0) {
152
154
  return true;
153
155
  }
154
156