Skip to content

Commit

Permalink
fix: add aria-labels to icon-only buttons (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronshekey committed Feb 1, 2022
1 parent 1933f6f commit b69c3e0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/shared/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ export function makeMenuIcon(
}

button.title = title;
button.setAttribute("aria-label", title);
button.dataset.controller = "s-tooltip";
button.dataset.sTooltipPlacement = "top";
button.dataset.key = key;
Expand Down Expand Up @@ -374,6 +375,7 @@ export function makeMenuLinkEntry(
dom.href = href;
dom.target = "_blank";
dom.title = title;
dom.setAttribute("aria-label", title);
dom.dataset.controller = "s-tooltip";
dom.dataset.sTooltipPlacement = "top";

Expand Down

0 comments on commit b69c3e0

Please sign in to comment.