Skip to content

Commit

Permalink
fix(a11y): wai aria label for icon component
Browse files Browse the repository at this point in the history
  • Loading branch information
carmelotaverniti authored Feb 7, 2024
1 parent 072df92 commit 3bfe2b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<svg [class]="iconClass">
<svg [attr.aria-hidden]="isAriaHidden" [attr.aria-label]="labelWaria" [class]="iconClass">
<use [attr.href]="iconHref" [attr.xlink:href]="iconHref"></use>
</svg>
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ export class ItIconComponent {
*/
protected assetBasePath: string;

/**
* Custom Waria label
*/
@Input() labelWaria: string | undefined;

get isAriaHidden(): boolean {
return this.labelWaria == undefined;
}

constructor() {
this.assetBasePath = inject(IT_ASSET_BASE_PATH);
}
Expand Down

0 comments on commit 3bfe2b4

Please sign in to comment.