Skip to content

Fix focus order for iOS VoiceOver on Product Plan page (W-11149828)#3592

Closed
cpeddamallu wants to merge 2 commits into
SFDO-Tooling:mainfrom
cpeddamallu:cpeddamallu/W-11149828
Closed

Fix focus order for iOS VoiceOver on Product Plan page (W-11149828)#3592
cpeddamallu wants to merge 2 commits into
SFDO-Tooling:mainfrom
cpeddamallu:cpeddamallu/W-11149828

Conversation

@cpeddamallu
Copy link
Copy Markdown

Summary

Fixes accessibility bug W-11149828 where focus was landing on the description link instead of the "Select a Plan" heading when using iOS VoiceOver with linear swipe navigation.

Changes

  • Add focus management to product and plan page headers (src/js/components/products/header.tsx, src/js/components/plans/header.tsx)
  • Programmatically focus the heading element on page mount using useEffect and useRef
  • Set tabindex="-1" on headings to make them programmatically focusable
  • Add CSS rule to remove visual focus outline for programmatic focus (src/sass/components/_header.scss)

What & Why

The issue violated WCAG 2.0 SC 2.4.3 (Focus Order) because the browser's default focus order placed focus on the first interactive element (BackLink) rather than the primary page heading. This is problematic for screen reader users who expect to land on the page heading first to understand page context.

The fix ensures that when the page loads:

  1. The heading receives programmatic focus first
  2. Screen readers (especially iOS VoiceOver) announce the heading
  3. Users understand the page context before encountering interactive elements

Testing

iOS VoiceOver:

  1. Open Safari on iOS with VoiceOver enabled
  2. Navigate to a product detail page
  3. Use linear swipe (swipe right) to navigate
  4. ✅ First focus should be on "Select a Plan" heading
  5. ❌ Previously focused on "Select a different product" link

Desktop screen readers: No change in behavior - headings remain in natural document flow

WCAG Compliance

  • WCAG 2.0 SC 2.4.3 Focus Order (Level A): ✅ Focus order preserves meaning by starting with page heading
  • WCAG 2.1 SC 2.4.6 Headings and Labels (Level AA): ✅ Headings presented in logical order

🤖 Generated with Claude Code

Chandrahasa Peddamallu and others added 2 commits May 15, 2026 14:38
@cpeddamallu cpeddamallu requested a review from a team as a code owner May 20, 2026 20:22
@salesforce-cla
Copy link
Copy Markdown

Thanks for the contribution! Unfortunately we can't verify the commit author(s): Chandrahasa Peddamallu <c***@c***.i***.s***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, sign the Salesforce Inc. Contributor License Agreement and this Pull Request will be revalidated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants