mitodl / ocw-hugo-themes

A Hugo theme for building OCW websites
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

download video / transcript buttons not keyboard navigable in firefox on mac #1283

Closed gumaerc closed 11 months ago

gumaerc commented 1 year ago

Expected Behavior

Using tab on the Download Video button should shift focus to the Download Transcript button

Current Behavior

Using tab on the Download Video button shifts focus to the next video tab -- Related resources, instead of "Download Transcript"

Steps to Reproduce

  1. Start a site with a video
  2. Browse to the video page
  3. Press tab until the download icon below the video is highlighted and press enter
  4. Press tab two more times and the next selections should be the "Download video" and "Download transcript" links, respectively

Additional Details

This was discovered while reviewing another PR that swapped out Chromium for Firefox and Google Chrome in Playwright tests. In switching to Google Chrome over Chromium, this issue was discovered to be a problem on Mac. More details are in this comment: https://github.com/mitodl/ocw-hugo-themes/pull/1281#pullrequestreview-1734345796

ChristopherChudzicki commented 11 months ago

I believe this is working as intended.

Firefox respects a MacOS system setting about keyboard navigation. If the setting is on, links are keyboard navigable. Otherwise, only buttons and input fields are keyboard navigable, which is apparently how MacOS native apps have traditionally behaved. See https://scholar.harvard.edu/ccwilcox/blog/how-keyboard-navigate-websites-mac-browsers#:~:text=Firefox%20%2D%20In%20the%20macOS%20System,the%20%22Keyboard%20navigation%22%20toggle.

Screenshot 2023-11-30 at 9 26 02 AM

I have verified that the links are in fact keyboard navigable if the setting is toggled on.

Users who rely on keyboard navigation on macs probably have this setting turned on, so their navigation works fine. Our e2e tests didn't pick it up because they run firefox in linux.

EDIT: This behavior might be coming to Chrome, too. At least it seems to behave this way in Chromium nightly on 2024-01-03. (Playwright uses Chromium nightly by efault.)

pt2302 commented 11 months ago

Closing this issue, since it appears to be working as intended.