jwplayer / ott-web-app

Reference implementation for JWP-powered apps
Apache License 2.0
70 stars 52 forks source link

Feat/accessibility fixes and improvements #451

Closed ChristiaanScheermeijer closed 7 months ago

ChristiaanScheermeijer commented 8 months ago

Description

This branch is rebased on #450 and contains a lot of accessibility improvements and fixes.

Most of the accessibility features are squashed into the first commit. Fixes and improvements for these features are added later. We should squash this, but it might help to do that after reviewing.

Most notable changes

Focus outline when using the tab key to navigate

When keyboard users navigate the site, the is-tabbing class name is added to the body element. This causes interactive elements to show an outline when being focussed.

image

Support keyboard interaction for many components

The following components have been optimized for keyboard navigation:

Modals & drawer as dialog

When a modal or drawer opens, the rest of the page becomes inert, and the focus stays within the opened dialog. The first interactive element is automatically focussed, and the focus is automatically returned to the originating element when the dialog is closed.

Contrast ratio fixes

The biggest contrast ratio issue was coming from the navbar when having a transparent background. The cover image on the video detail page could contain very light colors, making the navbar menu items badly visible. We have reduced the opacity of the menu items and added a fade over the cover image.

image

Screenreader announcements

We've found that on many occasions, it was not clear for screenreader users that a certain action had failed or succeeded. For example, when updating your account, there is no visual indication that the update has been applied. Instead of adding a form message (because some of these updates originate from forms within modals), we added an AriaAnnouncerProvider, which can provide feedback to screenreader users when the action is complete.

Empty homepage message

When GEO restricts your content and browsing from a restricted country, the home page will be empty. When this happens, we have added a generic message so that the user is aware that no more content will be shown on the site.

image

Related WCAG 2.1 (AA) requirements

github-actions[bot] commented 8 months ago

Visit the preview URL for this PR (updated for commit 180f578):

https://ottwebapp--pr451-feat-accessibility-f-m2ddpomu.web.app

(expires Sat, 23 Mar 2024 11:35:34 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c198f8a3a199ba8747819f7f1e45cf602b777529

ChristiaanScheermeijer commented 8 months ago

Needs rebase (after approving #450)

AntonLantukh commented 7 months ago

Looks like the "Related films" header has additional margin now on the mobile devices:

Screenshot 2024-02-21 at 10 25 44
AntonLantukh commented 7 months ago

The footer is overlapping the config info:

Screenshot 2024-02-21 at 10 52 45
ChristiaanScheermeijer commented 7 months ago

Looks like the "Related films" header has additional margin now on the mobile devices:

Screenshot 2024-02-21 at 10 25 44

This was broken indeed! Fixed it

AntonLantukh commented 7 months ago

Looks like menu items in the mobile sidebar are not outlined when tabbed (not sure if it is needed).

ChristiaanScheermeijer commented 7 months ago

@AntonLantukh I see this outline in the sidebar when tabbing:

image