Skip to content

fix(ios): expose pages to VoiceOver - #1266

Open
AurelienV-42 wants to merge 1 commit into
callstack:mainfrom
AurelienV-42:fix/ios-voiceover-page-accessibility
Open

AurelienV-42 wants to merge 1 commit into
callstack:mainfrom
AurelienV-42:fix/ios-voiceover-page-accessibility

Conversation

@AurelienV-42

Copy link
Copy Markdown

Summary

On iOS, the SwiftUI TabView shows each page to accessibility as one full-screen element. VoiceOver can still read a page element by element, but its rotor can't search inside the page: headings, links and form controls on the page never show up in the rotor. Screen reader users rely on headings to navigate long screens, so a feed inside a pager (for example with react-native-tab-view) can only be read linearly.

This PR:

  • overrides accessibilityElements on PagerViewProvider so it exposes the React Native view of the current page directly;
  • handles accessibilityScroll so the VoiceOver three-finger swipe still changes page (exposing the page directly skips TabView's own handling). It supports RTL and vertical orientation, respects scrollEnabled, and moves VoiceOver focus to the new page.

Test plan

Tested on a physical iPhone with VoiceOver on, using the example app (with accessibilityRole="header" added locally to the page title):

  • Basic Example: the headings rotor finds the page title.
  • Basic Example: three-finger swipe left/right changes page and VoiceOver focus follows.
  • MaterialTopBarExample: tab content is navigable, three-finger swipe changes tab and the tab bar updates.

This branch has not been deployed

No deployments
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.

1 participant