Skip to content

Commit

Permalink
Use role="alert" rather than role="alertdialog"
Browse files Browse the repository at this point in the history
dialogs/alertdialogs are intended to receive focus when they're shown. toasts, by their very nature, are not meant to steal focus but happen in parallel/as an aside
  • Loading branch information
patrickhlauke committed Apr 16, 2022
1 parent d979ac0 commit f459b99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/toastr/toast.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import { ToastrService } from './toastr.service';
<div *ngIf="title" [class]="options.titleClass" [attr.aria-label]="title">
{{ title }} <ng-container *ngIf="duplicatesCount">[{{ duplicatesCount + 1 }}]</ng-container>
</div>
<div *ngIf="message && options.enableHtml" role="alertdialog"
<div *ngIf="message && options.enableHtml" role="alert"
[class]="options.messageClass" [innerHTML]="message">
</div>
<div *ngIf="message && !options.enableHtml" role="alertdialog"
<div *ngIf="message && !options.enableHtml" role="alert"
[class]="options.messageClass" [attr.aria-label]="message">
{{ message }}
</div>
Expand Down

0 comments on commit f459b99

Please sign in to comment.