-
Notifications
You must be signed in to change notification settings - Fork 760
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
[#1730, #1773, #1820, #1849]Added screen reader alerts for various actions throughout the app. #1873
Conversation
7546241
to
88b3991
Compare
88b3991
to
ccf2fdf
Compare
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.
Some questions/suggestions before approval :)
const alert = document.createElement('span'); | ||
alert.innerText = msg; | ||
alert.setAttribute('role', 'alert'); | ||
alert.setAttribute('style', 'position: absolute; top: -9999px;'); |
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.
should we also make it a 0x0px <div>
so in the unlikely chance it gets on screen, it's still invisible?
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 tried this and you can't hide an element with text content: Example
I could give it an opacity of 0, but some screen readers do not read content with an opacity of 0.
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.
Oh yeah, I meant should we change it from <span>
to <div>
so that it is adjustable to 0px by 0px. Fiddler shows that as working with overflow: hidden
https://jsfiddle.net/sxygke3n/1/
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.
(also good to know about the opacity 0 thing, I didn't know that)
eaa2dc7
to
b95ebc5
Compare
Addressed feedback |
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.
Up to you on whether you want to implement <span>
to <div>
with overflow hidden. I still think it's a good idea.
@corinagum oh duh, |
b95ebc5
to
58afba4
Compare
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.
Awesome! :D
#1730, #1773, #1820, #1849
===
ariaAlertService.ts
inpackages/app/client
<span>
withrole="alert"
that will be read by any screen reader technologies and then removed after 5 seconds