-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix(toast): adding alert role for toast #492
Conversation
@rkaraivanov , @desig9stein , So I played with this some more based on this document: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/alert_role
@desig9stein could you please test role: alert on a Mac and see if it works? |
src/components/toast/toast.ts
Outdated
constructor() { | ||
super(); | ||
if (!this.hasAttribute('role')) { | ||
this.setAttribute('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.
You should move this to the connectedCallback hook.
As per the specification:
The element must not gain any attributes or children, as this violates the expectations of consumers who use the createElement or createElementNS methods.
@ChronosSF The reader on mac does not read anything with just the role, however, adding We use the same approach in Angular. |
Sadly, providing any aria-live seems to completely kill off the read out from Windows Narrator, but that seems to be the case with angular too. I guess having it read on Mac is better as we kinda go in the way of using nvda as baseline. |
Closes #479