-
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: Fix accessibility findings with app layout toolbar #3063
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3063 +/- ##
========================================
Coverage 96.34% 96.34%
========================================
Files 779 779
Lines 21914 21918 +4
Branches 7099 7505 +406
========================================
+ Hits 21113 21117 +4
Misses 794 794
Partials 7 7 ☔ View full report in Codecov by Sentry. |
role={navigationOpen ? 'presentation' : 'navigation'} | ||
aria-label={navigationOpen ? undefined : ariaLabels?.navigation} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make this code more error-proof, it could be a separate object
const navLandmarkAttributes = navigationOpen ? {role: 'presentation'} : {role: 'navigation', 'aria-label': ariaLabels?.navigation};
Description
Made the following app layout changes:
undefined
classname and testid findingsUnlabeled side navigation trigger
The issue we're facing is one of an unlabeled
nav
element on the page. We can't just assign theariaLabels.navigation
value to it, because we're already assigning to the open side navigation panel, and we can't have two navigation landmarks with the same labels. The "floating button" design doesn't have this issue because it goes away as soon as the panel is opened. We can do the same thing here, by just removing the navigation role around the button container when the panel is open.I didn't change the
nav
to adiv
out of pure caution - didn't want to give this change the chance to break any consumer tests.Related links, issue #, if available: AWSUI-60014
How has this been tested?
Passing existing tests, verified locally with VoiceOver. Will definitely need running through the dev pipeline (AwsUi-v3-dwaraa) and a dry-run (7134801478), just to be extra sure.
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.