Skip to content

Commit

Permalink
Fix icon only button accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobozzz committed Nov 25, 2024
1 parent 6922bcc commit d6eb99e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
5 changes: 4 additions & 1 deletion client/src/app/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
} @else {
<my-notification-dropdown class="margin-button"></my-notification-dropdown>

<my-button theme="tertiary" rounded="true" class="margin-button" icon="cog" ptRouterLink="/my-account"></my-button>
<my-button
i18n-title title="Go to the manage your account page"
theme="tertiary" rounded="true" class="margin-button" icon="cog" ptRouterLink="/my-account"
></my-button>

<div
class="logged-in-container" ngbDropdown #dropdown="ngbDropdown" placement="bottom-left auto"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@if (ptRouterLink || ptQueryParams) {
<a
class="action-button"
[ngClass]="classes" [ngbTooltip]="title"
[ngClass]="classes" [ngbTooltip]="tooltip" [title]="title"
[routerLink]="ptRouterLink" [queryParams]="ptQueryParams" [queryParamsHandling]="ptQueryParamsHandling" [routerLinkActive]="ptRouterLinkActive"
>
<ng-container *ngTemplateOutlet="content"></ng-container>
</a>
} @else {
<button type="button" class="action-button" [ngClass]="classes" [disabled]="disabled" [ngbTooltip]="title">
<button type="button" class="action-button" [ngClass]="classes" [disabled]="disabled" [ngbTooltip]="tooltip" [title]="title">
<ng-container *ngTemplateOutlet="content"></ng-container>
</button>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class ButtonComponent implements OnChanges, AfterViewInit {
@Input() ptRouterLinkActive = ''

@Input() title: string
@Input() tooltip: string
@Input({ transform: booleanAttribute }) active = false

@Input({ transform: booleanAttribute }) loading = false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<my-link class="d-flex" internalLink="/login" [href]="getExternalLoginHref()" [className]="className" [icon]="icon ? 'sign-in' : undefined">
<my-link
i18n-title title="Go to the login page"
class="d-flex"
internalLink="/login" [href]="getExternalLoginHref()"
[className]="className"
[icon]="icon ? 'sign-in' : undefined"
>
{{ label }}
</my-link>

0 comments on commit d6eb99e

Please sign in to comment.