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

USWDS - Table: Allow stacked table to be readable with VoiceOver + Safari combo #5477

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

mahoneycm
Copy link
Contributor

@mahoneycm mahoneycm commented Aug 30, 2023

Summary

Fixed a bug that prevented VoiceOver from reading stacked table content while using Safari.

Breaking change

This is not a breaking change

Related issue

Closes #5434

Related pull requests

Changelog →

Preview link

Stacked table →

Problem statement

Specifically when using VoiceOver on Safari, tables with display: block on the are skipped or read as empty.

This is caused by a well known bug1 which causes tables with display properties to break accessibility with screen readers.

This bug used to affect most browsers, but in recent years has been resolved. Safari seems to be the only browser still affected by this. At the time of this PRs creation the referenced article was last updated: August 14th, 2023.

Additional mdn doc PR with a well organzied list of associated bugs: mdn/browser-compat-data#19994

Solution

I was able to improve the screen reader experience by removing display: block from stacked table tr tags.

Now, VoiceOver + Safari can properly navigate through the stacked table’s content and read it’s values

Differences

There is one slight difference between the way VO + Safari read the table data compared to other browsers.

Other browsers will read cells data labels with “column # of #” depending on how many data cells there are in each row. In our example, this would be “column 1 of 3” for example.

Safari now reads this as “Column 1 of 1”. While this differs from the other browsers, it is considered accurate because there is only one column.

The downside is that it doesn’t let the user know how many “columns” (if table wasn't stacked) are within the said “row”.

VoiceOver will correctly read out how many “rows” (sections) of the stacked table there are.

This is caused by a Safari bug

Tables with display: block on the and give the wrong column count.2

Testing and review

Confirm existence of bug

  1. Visit develop branch stacked table variant on Safari
  2. Activate VoiceOver
  3. Attempt to navigate table using keyboard inputs
  4. Visit the stacked table variant on another browser
  5. Confirm proper readouts

Confirm improvement

  1. Visit preview on Safari →
  2. Confirm no visual regression
  3. Attempt to navigate the table with VoiceOver and keyboard inputs
  4. Confirm you are able to access all cell information
  5. Repeat for another browser
  6. Confirm no unexpected changes

Testing checklist

  • Stacked table is now accessible using VoiceOver + Safari
  • Confirm we’re comfortable with the readout addressing each row as a single column
  • No unexpected changes to other browsers
  • No visual regressions

Footnotes

  1. https://adrianroselli.com/2022/07/its-mid-2022-and-browsers-mostly-safari-still-break-accessibility-via-display-properties.html

  2. https://github.com/mdn/browser-compat-data/issues/19994

@amycole501
Copy link

Unable to test in Safari. Do you want me to test in JAWS and/or NVDA?

@mahoneycm
Copy link
Contributor Author

@amycole501 Yeah if you don't mind comparing to the develop builds with other browsers/screen readers to confirm no accidental readout changes that would be great!

Copy link
Contributor

@amyleadem amyleadem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mahoneycm, this is looking good! I like that there is a clean, one-line answer to an important bug fix.

I don’t see a big issue with Safari reading the content out as one column. It is not ideal but it is better than what we have now and does match the visual presentation.

I tested on Chrome, Safari, and Firefox with VoiceOver in MacOS. I also tested in iOS Safari with VoiceOver Gestures. I tested the following:

  • Confirmed existence of the bug with VoiceOver in Safari on MacOS and VoiceOver Gestures Safari on iOS
  • Confirm that the stacked table content is now accessible with VoiceOver in Safari VoiceOver Gestures in iOS Safari
  • Confirm no visual regression in Safari and other browsers
  • Confirm the readout makes sense
  • Confirm no visual or screen reader regression in other browsers

Copy link

@amycole501 amycole501 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The table sounds great in JAWS in Chrome. No issues detected and all rows were read correctly. I'm currently having issues with NVDA reading the table. However, I asked @alex-hull if it sounded OK to her and she said it's good; it read the table data and rows. I just installed an update to NVDA so I think it's just a glitch for me and the table is fine as-is.

@mahoneycm
Copy link
Contributor Author

@amycole501 Glad to hear it! Would you mind approving the PR if it looks good to you? Whenever you get the chance 😊

Copy link
Contributor

@mejiaj mejiaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good research on this.

Tested on Chromium, Firefox, Safari without visual regressions. As well as with VoiceOver. Removed the mobile width container to make sure desktop wasn't affected.

Copy link
Member

@thisisdano thisisdano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean fix, great documentation!

@thisisdano thisisdano merged commit 4a0280e into develop Sep 28, 2023
3 checks passed
@thisisdano thisisdano deleted the cm-stacked-table-voice-over-fix branch September 28, 2023 22:06
@thisisdano thisisdano mentioned this pull request Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

USWDS - Bug: Responsive stacked table cannot be parsed by VoiceOver on Safari
5 participants