Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NickColley
Copy link
Contributor

@NickColley NickColley commented Jul 21, 2024

  • Screen readers now announce when the dialog opens, this means it's now possible to download Elementary as a screen reader user (for example blind users).
  • Keyboard focus is "trapped" inside the modal so you cant accidentally get lost tabbing away from it until it is closed
  • No longer need to load leanmodal2 (or jQuery) for the modal feature meaning the page loads quicker.

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:

download elementary section inline the page instead of inside a modal

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:

Choose a Download dialog Download from a localized server or by magnet link. For help and more info, see the

Browser testing

Browser Result
Safari iOS 16 iPhone showing modal
Safari iOS 15 iPhone showing inline in the page
Chrome for Android (latest) Android showing modal
Safari 17.3 (latest) Safari showing modal
Safari 14.1 Safari showing inline in the page
Firefox 128 (latest) Firefox showing modal
Firefox 81 Firefox showing inline
Chrome (latest) Chrome showing modal
Internet Explorer It is inline in the page but the download button doesnt work to begin with on IE11 so it is already broken there - I assume we dont mind.

Note the modal icon is not shown in the screenshots because I cant get it to load for some reason, but it is unchanged.

@NickColley NickColley force-pushed the improve-modal branch 4 times, most recently from 88c8463 to dd6882c Compare July 24, 2024 21:44
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
<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=""/>
Copy link
Contributor Author

@NickColley NickColley Jul 24, 2024

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">
Copy link
Contributor Author

@NickColley NickColley Jul 24, 2024

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

@NickColley NickColley marked this pull request as ready for review July 24, 2024 22:25
@RMcNeely RMcNeely self-assigned this Jul 24, 2024
@RMcNeely RMcNeely added the a11y label Jul 24, 2024
@NickColley NickColley changed the title Replace leanmodal2 with native dialog element Ensure that the download modal is announced to screen reader users Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants