Skip to content

Commit d9933bd

Browse files
authored
fix(ui5-icon): Icon now has a correct role (#1652)
1 parent 61ce284 commit d9933bd

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

packages/main/src/CalendarHeader.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
name="{{_btnNext.icon}}"
5252
>
5353
</ui5-icon>
54-
54+
</div>
5555
</div>

packages/main/src/Icon.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
tabindex="{{tabIndex}}"
44
dir="{{dir}}"
55
viewBox="0 0 512 512"
6-
role="img"
6+
role="{{role}}"
77
focusable="false"
88
preserveAspectRatio="xMidYMid meet"
99
aria-label="{{accessibleNameText}}"

packages/main/src/Icon.js

+8
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,14 @@ class Icon extends UI5Element {
198198
return this.interactive ? "0" : "-1";
199199
}
200200

201+
get role() {
202+
if (this.interactive) {
203+
return "button";
204+
}
205+
206+
return this.accessibleNameText ? "img" : "presentation";
207+
}
208+
201209
static createGlobalStyle() {
202210
if (!window.ShadyDOM) {
203211
return;

0 commit comments

Comments
 (0)