Skip to content

Commit

Permalink
style: format
Browse files Browse the repository at this point in the history
  • Loading branch information
felixw committed Oct 30, 2023
1 parent 0faf96b commit e81901b
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions packages/components/src/components/notification/notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ export class Notification {
if (newValue === true) {
this.open();
this.lastCloseEventTrigger = 'ATTRIBUTE';


} else if (this.isOpen) {
this.close();
}
Expand All @@ -134,13 +132,14 @@ export class Notification {
}
});
// workaround: when role is status, the inner text needs to be changed in order to be announced by the screen reader correctly
if (this.innerRole === "status") {
if (this.innerRole === 'status') {
const text = this.hostElement.querySelector('[slot="text"]').innerHTML;
const heading = this.hostElement.querySelector('[slot="heading"]').innerHTML;
setTimeout( () => {
const heading =
this.hostElement.querySelector('[slot="heading"]').innerHTML;
setTimeout(() => {
this.hostElement.querySelector('[slot="text"]').innerHTML = text;
this.hostElement.querySelector('[slot="heading"]').innerHTML = heading;
}, 10)
}, 10);
}
};

Expand Down Expand Up @@ -188,10 +187,7 @@ export class Notification {
<IconTag size={ICON_SIZE} selected={this.type === 'toast'} />
</slot>
</div>
<div part="body"
role={this.innerRole}
aria-live="polite"
>
<div part="body" role={this.innerRole} aria-live="polite">
<div
part="heading"
role="heading"
Expand Down

0 comments on commit e81901b

Please sign in to comment.