Skip to content

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 5 times, most recently from dd6882c to 67846d9 Compare July 24, 2024 22:10
<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.

<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
@RMcNeely
Copy link
Contributor

Hi Nick sorry for the extremely long delay! Tested this and looks good to me in the a11y tree. I couldn't get a real screen reader setup with the site but this is still an improvement.

If you can resolve this conflict we'll merge this in 🙏

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

@RMcNeely thank you updated to match the new linting standards

@RMcNeely
Copy link
Contributor

Can you request a review so I can add one and then merge? I think that's what GH is complaining about

@NickColley
Copy link
Contributor Author

It's not letting me do that but the button should be top right here:

https://github.com/elementary/website/pull/3593/files

@RMcNeely RMcNeely merged commit 6666df9 into elementary:master Dec 13, 2025
5 checks passed
@NickColley NickColley deleted the improve-modal branch December 13, 2025 15:55
@janxious
Copy link

Just a driveby: nice work!

@NickColley
Copy link
Contributor Author

@janxious thank you friend ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Activating the Download button pops up options at the bottom of the page, but nothing is communicated to the screen reader about this

3 participants