Skip to content

Commit

Permalink
fix(ui5-icon): Icon now has a correct role (#1652)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladitasev authored May 20, 2020
1 parent 61ce284 commit d9933bd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/main/src/CalendarHeader.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
name="{{_btnNext.icon}}"
>
</ui5-icon>

</div>
</div>
2 changes: 1 addition & 1 deletion packages/main/src/Icon.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
tabindex="{{tabIndex}}"
dir="{{dir}}"
viewBox="0 0 512 512"
role="img"
role="{{role}}"
focusable="false"
preserveAspectRatio="xMidYMid meet"
aria-label="{{accessibleNameText}}"
Expand Down
8 changes: 8 additions & 0 deletions packages/main/src/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,14 @@ class Icon extends UI5Element {
return this.interactive ? "0" : "-1";
}

get role() {
if (this.interactive) {
return "button";
}

return this.accessibleNameText ? "img" : "presentation";
}

static createGlobalStyle() {
if (!window.ShadyDOM) {
return;
Expand Down

0 comments on commit d9933bd

Please sign in to comment.