-
Notifications
You must be signed in to change notification settings - Fork 162
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
fix: Make table column announcements less verbose for screen readers #3165
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3165 +/- ##
========================================
Coverage 96.40% 96.40%
========================================
Files 784 784
Lines 22136 22136
Branches 7602 7188 -414
========================================
Hits 21341 21341
- Misses 743 788 +45
+ Partials 52 7 -45 ☔ View full report in Codecov by Sentry. |
As far as I can see, this change means that the |
In chrome+VO when navigating between header cells I now get announcements of |
Table navigation is a big part of Cloudscape UX, and so I feel the additional friction when navigating table headers is worth it for the less verbose experience of navigating between multiple columns in a single row (because the information you need is behind this annoyingly long label).
This is a fair point, I'll make it prioritise the actual ariaLabel if one's provided. I'll still remove that bit off the documentation. |
Sadly closing - It's tenuously "better" on VoiceOver, but JAWS and NVDA don't like this fix. So it's just not worth it. |
Description
Basically, each column's
<th>
is typically labelled by its contents, which is normally fine. But because we could have two buttons in there (sort and resizer), what ends up happening is that each column is actually labelled with the same text multiple times, i.e.<column name> and <column name>
(sort button and resizer button).This also happens in screen readers when you move from one table body column to another (try VO+Arrow keys inside a table). This overrides that and makes sure the column label is only announced once by giving it an explicit label. I was unsure whether I wanted to get the label from the
column.ariaLabel
string, but we've been labelling the resizer with the visible text since forever and nobody's complained yet. Will also double check with our accessibility specialists next week before I merge this one.Plus the way we suggest using
column.ariaLabel
is a little inaccurate, so I scratched that off the API docs as well. Perhaps we could even deprecate this property, but I haven't really thought about it and I don't want to get ahead myself.Related links, issue #, if available: AWSUI-21306
How has this been tested?
Tested manually with VoiceOver, but added a unit test as well.
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md
.CONTRIBUTING.md
.Security
checkSafeUrl
function.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.