File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,12 @@ import { BaseNotification } from "./base-notification.component";
3131 </svg>
3232 <div class="cds--actionable-notification__text-wrapper">
3333 <div class="cds--actionable-notification__content">
34- <div *ngIf="!notificationObj.template" cdsActionableTitle [innerHTML]="notificationObj.title"></div>
34+ <div
35+ cdsActionableTitle
36+ *ngIf="!notificationObj.template"
37+ [id]="notificationID"
38+ [innerHTML]="notificationObj.title">
39+ </div>
3540 <div *ngIf="!notificationObj.template" cdsActionableSubtitle>
3641 <span [innerHTML]="notificationObj.message"></span>
3742 <ng-container *ngFor="let link of notificationObj.links">
@@ -82,7 +87,8 @@ export class ActionableNotification extends BaseNotification {
8287 this . _notificationObj = Object . assign ( { } , this . defaultNotificationObj , obj ) ;
8388 }
8489
85- @HostBinding ( "attr.id" ) notificationID = `notification-${ ActionableNotification . notificationCount ++ } ` ;
90+ notificationID = `actionable-notification-${ ActionableNotification . notificationCount ++ } ` ;
91+ @HostBinding ( "attr.aria-labelledBy" ) notificationLabel = this . notificationID ;
8692 @HostBinding ( "class.cds--actionable-notification" ) notificationClass = true ;
8793 @HostBinding ( "class.cds--actionable-notification--toast" ) get toastVariant ( ) { return this . notificationObj . variant === "toast" ; }
8894 @HostBinding ( "class.cds--actionable-notification--error" ) get isError ( ) { return this . notificationObj . type === "error" ; }
Original file line number Diff line number Diff line change @@ -26,7 +26,12 @@ import { BaseNotification } from "./base-notification.component";
2626 class="cds--inline-notification__icon">
2727 </svg>
2828 <div class="cds--inline-notification__text-wrapper">
29- <div *ngIf="!notificationObj.template" cdsNotificationTitle [innerHTML]="notificationObj.title"></div>
29+ <div
30+ cdsNotificationTitle
31+ *ngIf="!notificationObj.template"
32+ [innerHTML]="notificationObj.title"
33+ [id]="notificationID">
34+ </div>
3035 <div *ngIf="!notificationObj.template" cdsNotificationSubtitle>
3136 <span [innerHTML]="notificationObj.message"></span>
3237 </div>
@@ -62,7 +67,8 @@ export class Notification extends BaseNotification {
6267 this . _notificationObj = Object . assign ( { } , this . defaultNotificationObj , obj ) ;
6368 }
6469
65- @HostBinding ( "attr.id" ) notificationID = `notification-${ Notification . notificationCount ++ } ` ;
70+ notificationID = `notification-${ Notification . notificationCount ++ } ` ;
71+ @HostBinding ( "attr.aria-labelledBy" ) notificationLabel = this . notificationID ;
6672 @HostBinding ( "class.cds--inline-notification" ) notificationClass = true ;
6773 @HostBinding ( "class.cds--inline-notification--error" ) get isError ( ) { return this . notificationObj . type === "error" ; }
6874 @HostBinding ( "class.cds--inline-notification--info" ) get isInfo ( ) { return this . notificationObj . type === "info" ; }
You can’t perform that action at this time.
0 commit comments