Skip to content

feat(ios): voiceover read contents of input element#526

Open
eszlamczyk wants to merge 3 commits into
mainfrom
fix/accesibility/text-input-voice-over
Open

feat(ios): voiceover read contents of input element#526
eszlamczyk wants to merge 3 commits into
mainfrom
fix/accesibility/text-input-voice-over

Conversation

@eszlamczyk

@eszlamczyk eszlamczyk commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

What/Why?

EnrichedMarkdownTextInput was effectively invisible to VoiceOver on iOS - focusing it announced nothing ("description
unavailable"), it exposed no value, and consumer accessibility props weren't forwarded.

Root cause: the input's inner UITextView uses a custom TextKit 1 stack, so it doesn't vend native text accessibility, and the Fabric host collapsed the subtree into an empty element.

This makes the host present itself as a single VoiceOver element that reads the field's content as one paragraph:

  • isAccessibilityElement + accessibilityValue → the full plain text (placeholder when empty).
  • accessibilityActivate → focuses the field and opens the keyboard for editing.
  • Placeholder label excluded from the accessibility label so it doesn't shadow the real text.

Consumer accessibilityLabel/accessibilityHint now land on the host and are announced. Android already worked (native EditText), so this is iOS-only. Known limitations (no native "text field" role, no in-field cursor nav/echo, value refreshes on re-focus) are documented in docs/ACCESSIBILITY.md.

Testing

Everything was tested via playground (with xcode Accessability Manager
Android checked on real device.

Screenshots

image

PR Checklist

  • Code compiles and runs on iOS
  • Code compiles and runs on Android
  • Updated documentation/README if applicable
  • Ran example app to verify changes
  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

Adresses #521

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves iOS VoiceOver support for EnrichedMarkdownTextInput by making the Fabric host view present itself as a single accessibility element that exposes the editor’s current plain-text contents (or placeholder when empty) and can be activated to focus/open the keyboard. It also documents the simplified accessibility model and limitations in docs/ACCESSIBILITY.md.

Changes:

  • iOS: mark the host component as an accessibility element, provide accessibilityValue, and implement accessibilityActivate to focus the underlying text view.
  • iOS: attempt to hide the placeholder label from accessibility to avoid conflicting announcements.
  • Docs: add a dedicated section describing the input accessibility behavior on iOS/Android and list known limitations.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
packages/react-native-enriched-markdown/ios/input/EnrichedMarkdownTextInput.mm Adds iOS VoiceOver support by vending a single accessibility element/value and activation behavior for the editor.
docs/ACCESSIBILITY.md Documents the text input accessibility model and its limitations across iOS and Android.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants