diff --git a/src/components/notification/notification.ts b/src/components/notification/notification.ts index b98c6618473..11434bd5b0e 100644 --- a/src/components/notification/notification.ts +++ b/src/components/notification/notification.ts @@ -130,6 +130,7 @@ export class SbbNotificationElement extends LitElement { public override connectedCallback(): void { super.connectedCallback(); + this.setAttribute('role', this.getAttribute('role') ?? 'status'); this._handlerRepository.connect(); this._setInlineLinks(); } @@ -202,7 +203,6 @@ export class SbbNotificationElement extends LitElement { protected override render(): TemplateResult { const hasTitle = !!this.titleContent || this._namedSlots['title']; - setAttribute(this, 'role', 'status'); setAttribute(this, 'data-state', this._state); setAttribute(this, 'data-has-title', hasTitle);