diff --git a/packages/app/client/src/ui/shell/explorer/notificationsExplorer/notificationsExplorer.scss b/packages/app/client/src/ui/shell/explorer/notificationsExplorer/notificationsExplorer.scss index 80f9dc30b..d27ac43a2 100644 --- a/packages/app/client/src/ui/shell/explorer/notificationsExplorer/notificationsExplorer.scss +++ b/packages/app/client/src/ui/shell/explorer/notificationsExplorer/notificationsExplorer.scss @@ -24,3 +24,9 @@ margin: 0; margin-top: 15px; } + +.aria-live-region { + position: absolute; + top: -9999px; + overflow: hidden; +} diff --git a/packages/app/client/src/ui/shell/explorer/notificationsExplorer/notificationsExplorer.scss.d.ts b/packages/app/client/src/ui/shell/explorer/notificationsExplorer/notificationsExplorer.scss.d.ts index 8b1d610d0..aa25c731a 100644 --- a/packages/app/client/src/ui/shell/explorer/notificationsExplorer/notificationsExplorer.scss.d.ts +++ b/packages/app/client/src/ui/shell/explorer/notificationsExplorer/notificationsExplorer.scss.d.ts @@ -2,3 +2,4 @@ export const notificationsExplorer: string; export const clearAllNotificationsBtn: string; export const noNotificationsMsg: string; +export const ariaLiveRegion: string; diff --git a/packages/app/client/src/ui/shell/explorer/notificationsExplorer/notificationsExplorer.tsx b/packages/app/client/src/ui/shell/explorer/notificationsExplorer/notificationsExplorer.tsx index 5db47ff8b..3889f230a 100644 --- a/packages/app/client/src/ui/shell/explorer/notificationsExplorer/notificationsExplorer.tsx +++ b/packages/app/client/src/ui/shell/explorer/notificationsExplorer/notificationsExplorer.tsx @@ -48,6 +48,8 @@ interface NotificationExplorerProps { } class NotificationsExplorerComp extends React.Component> { + private spanNotificationRef: HTMLSpanElement; + constructor(props: NotificationExplorerProps) { super(props); } @@ -56,6 +58,12 @@ class NotificationsExplorerComp extends React.Component { + this.spanNotificationRef.innerText = notifications.length + ? `${notifications.length} new notifications` + : 'No new notifications'; + }, 500); + // max-height: 100% of explorer pane - 20px (Clear all button height) - 40px (Explorer title height) return ( <> @@ -70,6 +78,12 @@ class NotificationsExplorerComp extends React.ComponentNo new notifications.

)} + ); } @@ -81,6 +95,10 @@ class NotificationsExplorerComp extends React.Component ); }; + + private setSpanNotificationRef = (ref: HTMLSpanElement): void => { + this.spanNotificationRef = ref; + }; } const mapStateToProps = (state: RootState): NotificationExplorerProps => {