From 1d18f6e13c68dd3cb3bfdb509fe816070592d3ce Mon Sep 17 00:00:00 2001 From: Marco D'Auria Date: Thu, 8 Feb 2024 16:27:07 +0100 Subject: [PATCH] fix: remove role="status" --- src/components/notification/notification.spec.ts | 8 ++++---- src/components/notification/notification.ts | 1 - src/components/notification/readme.md | 10 +++------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/components/notification/notification.spec.ts b/src/components/notification/notification.spec.ts index 23392d4fb11..30a8522680d 100644 --- a/src/components/notification/notification.spec.ts +++ b/src/components/notification/notification.spec.ts @@ -21,7 +21,7 @@ describe('sbb-notification', () => { expect(root).dom.to.be.equal( ` - + The quick brown fox jumps over the lazy dog. `, ); @@ -39,7 +39,7 @@ describe('sbb-notification', () => { expect(root).dom.to.be.equal( ` - + The quick brown fox jumps over the lazy dog. `, ); @@ -58,7 +58,7 @@ describe('sbb-notification', () => { expect(root).dom.to.be.equal( ` - + Slotted title @@ -79,7 +79,7 @@ describe('sbb-notification', () => { expect(root).dom.to.be.equal( ` - + The quick brown fox jumps over the lazy dog. `, ); diff --git a/src/components/notification/notification.ts b/src/components/notification/notification.ts index 08b73dd1d92..43f3a65879a 100644 --- a/src/components/notification/notification.ts +++ b/src/components/notification/notification.ts @@ -129,7 +129,6 @@ export class SbbNotificationElement extends LitElement { public override connectedCallback(): void { super.connectedCallback(); - this.setAttribute('role', this.getAttribute('role') ?? 'status'); this._setInlineLinks(); } diff --git a/src/components/notification/readme.md b/src/components/notification/readme.md index 33927a216ce..359f478316b 100644 --- a/src/components/notification/readme.md +++ b/src/components/notification/readme.md @@ -60,17 +60,13 @@ For example, use `--sbb-notification-margin: 0 0 var(--sbb-spacing-fixed-4x) 0` ## Accessibility -The `sbb-notification` component uses the accessibility `role="status"` to indicate its purpose to assistive technology users. -This role signifies that the notification provides information about the current state of a task or system. - -Consumers can override the role's default value by setting it on the component; -moreover, to announce the notification's content to screen readers as it becomes visible, -consumers **must** use the `aria-live` attribute with the `off` value on the component's container. +In order to announce the notification's content to screen readers as it becomes visible, +consumers **must** use the `aria-live` attribute with the `polite` value on the component's container. This ensures that users who rely on screen readers are promptly informed of any relevant updates or changes. ```html -
+
Task successfully completed.
```