-
-
Notifications
You must be signed in to change notification settings - Fork 707
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
Ensure that the download modal is announced to screen reader users #3593
base: master
Are you sure you want to change the base?
Conversation
88c8463
to
dd6882c
Compare
Adds a lot of good features that make it way more accessible like preventing outside elements from being focused, which can be difficult to do otherwise. Removes dependency on leanmodel2 so quicker page loads. TODO before ready: - Fallback gracefully in browsers that dont support it - Test in real screen readers
dd6882c
to
67846d9
Compare
<div id="download-modal" class="dialog modal"> | ||
<img alt="Download elementary OS icon" src="images/icons/apps/48/system-os-installer.svg"> | ||
<dialog id="download-modal" class="dialog" aria-labelledby="download-modal-title"> | ||
<img src="images/icons/apps/48/system-os-installer.svg" alt=""/> |
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 have set the alt to nothing to mark the image as presentational as it is just for show.
@@ -467,21 +467,21 @@ | |||
|
|||
<span id="translate-download" style="display:none;" hidden>Download elementary OS</span> | |||
<span id="translate-purchase" style="display:none;" hidden>Purchase elementary OS</span> | |||
<div id="download-modal" class="dialog modal"> | |||
<img alt="Download elementary OS icon" src="images/icons/apps/48/system-os-installer.svg"> | |||
<dialog id="download-modal" class="dialog" aria-labelledby="download-modal-title"> |
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.
Here I label the dialog based on the heading so that the dialog has a clear name "Choose a Download modal dialog" etc
I did consider improving the current implementation, I think adding focus management would have been fine but keyboard trapping is non-trivial so that's why adopting this is worthwhile as we get all that for free.
Resolves #3378
Browser support strategy
For browsers that do not support the native dialog we aim to show them this at the bottom of the page:
Which'll be linked to using regular anchor jumping.
For users that support the dialog element it'll look the same as it currently does.
I have not been able to test what happens when someone donates as I cant get stripe working locally but it should work since I've just changed the internal modal and not the place it gets called.
Screen reader testing
NVDA
Using https://assistivlabs.com/.
When I open the dialog I get this announced:
Browser testing
Note the modal icon is not shown in the screenshots because I cant get it to load for some reason, but it is unchanged.