Skip to content

Commit

Permalink
fix(a11y): replace offcavas title with aria-label when not displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-gavanier committed Nov 28, 2023
1 parent 73fc34e commit 3707cab
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
[class.hiding]="hiding$ | async"
tabindex="-1"
[id]="id"
[attr.aria-labelledby]="id + '-label'"
[attr.aria-labelledby]="useHeader ? id + '-label' : null"
[attr.aria-label]="useHeader ? null : heading"
[attr.aria-modal]="(expanded$ | async) ? 'true' : null"
[attr.role]="(expanded$ | async) ? 'dialog' : null"
style="max-width: 500px">
<div [class.offcanvas-header]="useHeader">
<h2 class="h5" [class.visually-hidden]="!useHeader" [id]="id + '-label'">{{ heading }}</h2>
<h2 *ngIf="useHeader" class="h5" [id]="id + '-label'">{{ heading }}</h2>
<button
*ngIf="useHeader && useCloseButton"
type="button"
Expand Down

0 comments on commit 3707cab

Please sign in to comment.