department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
282 stars 200 forks source link

Staging Review finding: Keyboard focus goes to different places when following each link #84240

Closed shiragoodman closed 3 months ago

shiragoodman commented 3 months ago

Need help? Please review how to read a Staging Review ticket. Tag @platform-governance-team-members on Slack if you need further assistance.

Product Information

Team: Cartographers Product: MHV on VA.gov Feature: MHV Secondary Nav

Findings details

VA.gov Experience Standard - issue: User encounters design components that are inconsistent or confusing. VA.gov Experience Standard - category: Consistency Launch-blocking: No Design System review: No Collab Cycle Reviewer: @briandeconinck (Accessibility)

Description

When navigating the secondary navigation using keyboard, there's inconsistent behavior in where keyboard focus lands as you move to each page.

Focus management on VA.gov is a little inconsistent across the board, but within a single context like this that inconsistency is more exposed.

This issue could be frustrating for keyboard-only users. From the user's perspective, there's not any reason why these pages should be different and there's not a clear pattern for when to expect one behavior versus the other. Sometimes you've got to navigate past all the stuff in the header, sometimes you don't, luck of the draw.

For screen reader users, the issue becomes a little more significant. You get dropped in different places on the page but you may not have the same visual context to recognize where you've been dropped and how to get where you want to go.

Link, screenshot or steps to recreate Steps to reproduce: 1. Log in with test user and navigate to [/my-health/](https://staging.va.gov/my-health/). 2. Press [tab] to move focus to the Appointments link. 3. Press [enter] to follow the link. 4. Note that a focus indicator is visible around the H1 on the Appointments page. 5. Press [tab] to move to the next focusable element. It will be in the main content of the page. 6. Press [shift] + [tab] to move focus back to the Records link. 7. Press [enter] to follow the link. 8. Note that no visible focus indicator is present. 9. Press [tab] to move to the next focusable element. It will be in the sitewide header.

Recommended action

Recommend matching the focus management in place on Appointments, Messages, and Medications. When following the nav links to My HealtheVet and Records, focus should be set to the H1 using tabindex="-1".

References


Next Steps for the VFS Team

Cartographers ACs

brea11y commented 3 months ago

I agree with the recommended updates and would move forward with these changes.

radavis commented 3 months ago

Example of how to set focus: https://github.com/department-of-veterans-affairs/vets-website/blob/16f26e0/src/applications/personalization/profile/components/personal-health-care-contacts/PersonalHealthCareContacts.jsx#L32-L40

allanto-ah commented 3 months ago

Cartographer QA reviewed completed. No issues