-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(notification-system): add screen reader announcer #745
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,12 @@ type CustomOptions = { | |
* | ||
* Can be used to trigger multiple notifications at different positions on the screen at the same time | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add "also used to find which ScreenReader identity to send the SR Announcement to, in case screenReaderAnnouncement is defined" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'm not sure this is needed, users of this component don't need to know the inner workings of the SR part |
||
*/ | ||
notificationSystemId?: string; | ||
notificationSystemId: string; | ||
/** | ||
* Screen reader announcement to be made. | ||
* No announcement will be made if this is not provided. | ||
*/ | ||
screenReaderAnnouncement?: string; | ||
}; | ||
|
||
export type UpdateOptionsType = UpdateOptions & CustomOptions; | ||
|
@@ -97,7 +102,7 @@ export interface Props { | |
/** | ||
* Custom id for overriding this component's CSS. | ||
*/ | ||
id?: string; | ||
id: string; | ||
|
||
/** | ||
* Custom style for overriding this component's CSS. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this react-toastify ToastContainer is giving the role="alert" to that wrapper (with empty "" aria-label !). Role="alert" could interfere with our new SRAnnouncement. So let's pass role: "generic" to commonProps so that the DOM gets no role="alert" wrapper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(not doing, as discussed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oki, we are doing this later so that non IMC notifications are still announced with role="alert"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, or maybe it won't be needed when you do your PR?