Add role="alert" to callouts only when enforceAlert is passed (#528)

* Add role="alert" to callouts when enforceAlert is passed

* Remove ElementRef and do a different way

* Rename input variable
This commit is contained in:
Robyn MacCallum 2021-10-26 11:41:46 -04:00 committed by GitHub
parent 0f9c2205d5
commit 031cbff556
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,5 @@
<div class="callout callout-{{calloutStyle}}" [ngClass]="{'clickable': clickable}" role="alert">
<div #callout class="callout callout-{{calloutStyle}}" [ngClass]="{'clickable': clickable}"
[attr.role]="useAlertRole ? 'alert' : null">
<h3 class="callout-heading" *ngIf="title">
<i class="fa {{icon}}" *ngIf="icon" aria-hidden="true"></i>
{{title}}

View File

@ -19,6 +19,7 @@ export class CalloutComponent implements OnInit {
@Input() clickable: boolean;
@Input() enforcedPolicyOptions: MasterPasswordPolicyOptions;
@Input() enforcedPolicyMessage: string;
@Input() useAlertRole = false;
calloutStyle: string;