fix(a11y): focus inputs on enter and page transitions#3671
Merged
Conversation
Contributor
SDK Size
|
oliverlaz
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Goal
When a screen-reader user opens a channel or thread, VoiceOver/TalkBack focus previously landed on an arbitrary stop (the back button, or a message mid-list). This moves the entry point to where the user acts — the message composer — while keeping the header/back reachable via standard OS gestures.
useSetAccessibilityFocus()- a public, generic primitive that moves the screen reader cursor onto a ref/node (SR-gated, RAF deferred). It only moves accessibility focus; it never opens the keyboard or activates the field.useScreenReaderMountFocus(ref)- built on the primitive; focuses on mount (and once the SR state resolves).MessageComposeruses it oninputBoxRef, so the composer is focused on entry. This is the path that lands Android forward navigation as well (but not always on iOS, which is why we need the actual transitional effect as well)SampleAppreference implementation:useScreenReaderComposerFocusEffect- wires React Navigation'stransitionEndtouseSetAccessibilityFocus, covering back navigation (both platforms) and iOS forward navigation (where firing on mount loses a race with the OS focus pass). Returns a stablesetInputReffor<Channel>.accessibilityRole='header'on the screen header title (reachable via iOS Headings rotor / jump to top and Android Headings reading control swipe up) andonAccessibilityEscape->goBackon the screen root for the iOS back scrub (Android uses the system Back gesture).Note:
onAccessibilityEscapeis inert on a layout onlyViewunderFabric- it gets flattened and never receives the gesture. The view hosting it needscollapsable={false}if it does not apply anylayoutrelevant props itself.🛠 Implementation details
🎨 UI Changes
iOS
Android
🧪 Testing
☑️ Checklist
developbranch