@iyulab/components 2.39.0 → 2.39.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.39.1] - 2026-10-31
4
+
5
+ ### Fixed
6
+
7
+ - **`u-button` no longer puts `role="none"` on a host that carries `aria-*`.** 2.39.0 made every host presentational;
8
+ on a host with `aria-pressed`, `aria-expanded` or `aria-haspopup` that is invalid ARIA (those states are not allowed
9
+ on `role="none"`, and accessibility checkers report it as critical), and with a global attribute such as
10
+ `aria-label` browsers ignore `role="none"` anyway. The host is presentational only while it has no `aria-*`
11
+ attribute, and the role follows when one is added or removed. Your own role still wins.
12
+
3
13
  ## [2.39.0] - 2026-10-31
4
14
 
5
15
  ### Added
@@ -116,6 +116,13 @@ export declare class UButton extends UElement {
116
116
  connectedCallback(): void;
117
117
  disconnectedCallback(): void;
118
118
  private readonly aria;
119
+ /**
120
+ * 감싸기만 하는 호스트는 표시용(`role="none"`)으로 둔다 — 소비자가 호스트에 건 click 리스너도 스크린리더가
121
+ * «클릭 가능» 으로 읽게 하기 때문이다. 단 호스트에 `aria-*` 가 하나라도 있으면 두지 않는다: `aria-pressed` ·
122
+ * `aria-expanded` 같은 상태는 `none` 에 허용되지 않고(검사기가 치명 위반으로 본다), `aria-label` 같은 전역
123
+ * 속성이 있으면 브라우저가 `none` 을 어차피 무시한다. 작성자의 role 이 이긴다.
124
+ */
125
+ private syncHostRole;
119
126
  /** 호스트에서 시작하는 클릭(`button.click()`)은 섀도 루트를 지나지 않는다 — 같은 규칙(비활성 · 제출)을 여기서. */
120
127
  click(): void;
121
128
  /**
@@ -68,12 +68,23 @@ var UButton = class UButton extends UElement {
68
68
  super.connectedCallback();
69
69
  if (!this.internals && "attachInternals" in this) this.internals = this.attachInternals();
70
70
  this.renderRoot.addEventListener("click", this.handleClick);
71
- this.aria.set("role", "none");
71
+ this.syncHostRole();
72
72
  }
73
73
  disconnectedCallback() {
74
74
  this.renderRoot.removeEventListener("click", this.handleClick);
75
75
  super.disconnectedCallback();
76
76
  }
77
+ /**
78
+ * 감싸기만 하는 호스트는 표시용(`role="none"`)으로 둔다 — 소비자가 호스트에 건 click 리스너도 스크린리더가
79
+ * «클릭 가능» 으로 읽게 하기 때문이다. 단 호스트에 `aria-*` 가 하나라도 있으면 두지 않는다: `aria-pressed` ·
80
+ * `aria-expanded` 같은 상태는 `none` 에 허용되지 않고(검사기가 치명 위반으로 본다), `aria-label` 같은 전역
81
+ * 속성이 있으면 브라우저가 `none` 을 어차피 무시한다. 작성자의 role 이 이긴다.
82
+ */
83
+ syncHostRole() {
84
+ if (!this.isConnected) return;
85
+ const hasAria = this.getAttributeNames().some((n) => n.startsWith("aria-"));
86
+ this.aria.set("role", hasAria ? null : "none");
87
+ }
77
88
  /** 호스트에서 시작하는 클릭(`button.click()`)은 섀도 루트를 지나지 않는다 — 같은 규칙(비활성 · 제출)을 여기서. */
78
89
  click() {
79
90
  if (this.effectivelyDisabled || this.loading) return;
@@ -96,7 +107,10 @@ var UButton = class UButton extends UElement {
96
107
  }
97
108
  attributeChangedCallback(name, old, value) {
98
109
  super.attributeChangedCallback(name, old, value);
99
- if (FORWARDED_ARIA.includes(name)) this.requestUpdate();
110
+ if (FORWARDED_ARIA.includes(name)) {
111
+ this.syncHostRole();
112
+ this.requestUpdate();
113
+ }
100
114
  }
101
115
  updated(changed) {
102
116
  super.updated(changed);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iyulab/components",
3
3
  "description": "web-components library based on lit-element made by iyulab",
4
- "version": "2.39.0",
4
+ "version": "2.39.1",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "components",