@threadlabs/looma 0.30.0 → 0.30.1

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.
@@ -43,9 +43,10 @@ function connect(host) {
43
43
  const releaseAnchor = () => {
44
44
  if (!anchor) return;
45
45
  anchor.removeEventListener("click", onAnchorClick);
46
+ // Restore metadata without restoring a consumer's stale open state.
46
47
  for (const [name, value] of Object.entries(anchorAria ?? {})) {
47
48
  if (value === null) anchor.removeAttribute(name);
48
- else anchor.setAttribute(name, value);
49
+ else anchor.setAttribute(name, name === "aria-expanded" ? "false" : value);
49
50
  }
50
51
  anchor = null;
51
52
  anchorAria = null;
@@ -42,7 +42,8 @@ function connect(host) {
42
42
  if (!anchor) return;
43
43
  anchor.removeEventListener("click", onAnchorClick);
44
44
  if (anchorExpanded === null) anchor.removeAttribute("aria-expanded");
45
- else anchor.setAttribute("aria-expanded", anchorExpanded);
45
+ // A consumer may have mounted us after setting true; released anchors are collapsed.
46
+ else anchor.setAttribute("aria-expanded", "false");
46
47
  anchor = null;
47
48
  anchorExpanded = null;
48
49
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.30.0",
3
+ "version": "0.30.1",
4
4
  "type": "module",
5
5
  "description": "Looma components as HTML, Vue, and plain DOM, with design tokens.",
6
6
  "license": "MIT",
@@ -7328,7 +7328,7 @@ function connect$7(host) {
7328
7328
  if (!anchor) return;
7329
7329
  anchor.removeEventListener("click", onAnchorClick);
7330
7330
  for (const [name, value] of Object.entries(anchorAria ?? {})) if (value === null) anchor.removeAttribute(name);
7331
- else anchor.setAttribute(name, value);
7331
+ else anchor.setAttribute(name, name === "aria-expanded" ? "false" : value);
7332
7332
  anchor = null;
7333
7333
  anchorAria = null;
7334
7334
  };
@@ -8367,7 +8367,7 @@ function connect$5(host) {
8367
8367
  if (!anchor) return;
8368
8368
  anchor.removeEventListener("click", onAnchorClick);
8369
8369
  if (anchorExpanded === null) anchor.removeAttribute("aria-expanded");
8370
- else anchor.setAttribute("aria-expanded", anchorExpanded);
8370
+ else anchor.setAttribute("aria-expanded", "false");
8371
8371
  anchor = null;
8372
8372
  anchorExpanded = null;
8373
8373
  };