Repository navigation
feat(renderer): add accessibility actions - #874
Open
patrickkabwe wants to merge 1 commit into
Open
patrickkabwe wants to merge 1 commit into
patrickkabwe wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
patrickkabwe
force-pushed
the
feat/a11y-actions
branch
from
December 1, 2026 20:35
3eb43e1 to
8f1f939
Compare
patrickkabwe
force-pushed
the
feat/a11y-actions
branch
from
December 2, 2026 13:33
8f1f939 to
8f804ef
Compare
patrickkabwe
marked this pull request as ready for review
December 2, 2026 13:39
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.
Part of #838 (step 7). Stacked on #872.
Views take
accessibilityActionsandonAccessibilityAction. ARIA has no equivalent, so they keep React Native's names.The issue left the shape open. The handler receives
{ actionName }rather than React Native'sevent.nativeEvent.actionName, since the renderer has no synthetic events. Happy to change it if we want closer React Native compatibility.activate,increment,decrement,longpress,escape,magicTap,expandandcollapsemap to platform actions. Any other name is a custom action read as itslabel.longpress,expand,collapse) becomeUIAccessibilityCustomActions. UIKit asks the view itself foractivate,increment,decrement,escapeandmagicTap, soNativeContainerView(View) andLabelView(Text) override those and forward declared ones, falling back to UIKit otherwise. Other components get custom actions only. The two properties live in their ownpublic extension ViewbecauseCallbackneeds a publicNitroModulesimport.activateis click,incrementis scroll forward,escapeis dismiss, ...) and handles them inperformAccessibilityAction. Custom actions get ids from0x3f000000up, outside framework and app resource ids.WeakMap, so an inline arrow function doesn't call native on every render.detachDeletedInstanceclears the callback for views that set one, which breaks a cycle through a handler that captures the view. Views without a handler make no extra call on deletion.sliderwithincrement,decrementand a custom "Reset duration" action.Tested with a temporary self-test, since VoiceOver and TalkBack can't be driven here. It called
accessibilityIncrement()twice and then the custom action's handler on iOS, andViewCompat.performAccessibilityActionwith scroll forward twice and then the custom id on Android. On both platforms the duration went from 0.6 to 1.0 and back to 0.6, and the node read as adjustable (AXAdjustable, AndroidSeekBar). Leaving and reopening the screen, which deletes the view and clears the callback, worked on both.Re-tested after the move to ARIA names and the rebase onto main: the duration reads as a slider (
AXAdjustable, AndroidSeekBar). The action code itself didn't change, so the self-test wasn't repeated.