Repository navigation
Stop routing TalkBack's click to removed accessibility actions on Android - #59076
Open
YevheniiKotyrlo wants to merge 2 commits into
Open
YevheniiKotyrlo wants to merge 2 commits into
YevheniiKotyrlo wants to merge 2 commits into
Conversation
Contributor
Author
YevheniiKotyrlo
marked this pull request as ready for review
October 14, 2026 14:12
YevheniiKotyrlo
force-pushed
the
fix/android-removed-accessibility-actions
branch
from
October 16, 2026 10:12
c9b7c00 to
2e2da47
Compare
YevheniiKotyrlo
force-pushed
the
fix/android-removed-accessibility-actions
branch
from
November 11, 2026 14:42
2e2da47 to
3e0726b
Compare
Contributor
Author
|
@javache, without this change TalkBack's double-tap on a view whose |
cortinico
approved these changes
Nov 13, 2026
cortinico
left a comment
Contributor
There was a problem hiding this comment.
Code looks good, but build_fantom_runner and test_react_common_cxx are failing. Can we fix it?
…roid A view whose accessibilityActions declared activate kept dispatching it on TalkBack's click after the actions were removed or replaced with an empty list, so the view's own click never ran. setAccessibilityActions returned before writing the tag when the prop was null, and ReactAccessibilityDelegate routed an action through a map of every action it had built node info with, which only recycling cleared. setAccessibilityActions now writes null to the tag, and the delegate resolves an action against the view's current accessibilityActions. The map goes, and prepareToRecycle with it: recycling already resets the actions tag the delegate now reads.
YevheniiKotyrlo
force-pushed
the
fix/android-removed-accessibility-actions
branch
from
November 13, 2026 17:08
3e0726b to
c74031a
Compare
Visual regressionNo visual differences at ios: no capture |
The click reaches the view once activate is removed and longpress stays declared, so the delegate's lookup also runs over a list that holds no action for it.
Contributor
Author
|
Both failed before building anything: the runner couldn't resolve |
This branch has not been deployed
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.


Summary:
A view that declared an
activateaction keeps taking TalkBack's click after itsaccessibilityActionsare removed or replaced with[]: the double-tap dispatchesonAccessibilityActionwithactivate, and the view's own click, such as aPressable'sonPress, never runs. Two places keep the removed action.BaseViewManager.setAccessibilityActionsreturns before writing the tag when the prop isnull, so the previous array stays on the view, andReactAccessibilityDelegate.performAccessibilityActionroutes throughaccessibilityActionsMap, which records every action it built node info with and forgets them only when the view is recycled.This writes the
nullthrough, and the delegate resolves an incoming action against the view's currentaccessibilityActionsinstead of the map, so a declared action is routed as before and a removed one falls through to the view's own handling. Without the map,prepareToRecycle()(#59047) has nothing to clear, so it goes too:prepareToRecycleViewalready resets the actions tag the delegate now reads.Changelog:
[ANDROID] [FIXED] - Removing or emptying
accessibilityActionsno longer leaves TalkBack's click on the removed actionTest Plan:
New cases in
BaseViewManagerTestsetaccessibilityActionsthrough the view manager, build the node info as TalkBack does, and perform an accessibility click. Before the change four fail: the click is not performed after theactivateaction is removed, after the actions are replaced with[], nor afteractivateis removed whilelongpressstays (expected:<[1]> but was:<[0]>), and a removed custom action is still in the node info. A declaredactivatetakes the click with and without the change. With it,./gradlew :packages:react-native:ReactAndroid:testDebugUnitTest -PenableWarningsAsErrors=truepasses forBaseViewManagerTest,ReactAccessibilityDelegateTestandReactTextViewPropertyTest(54 tests),testRecycledViewPerformsItsOwnAccessibilityClickamong them; the rest ofbuild_androidwas not run.RNTester with TalkBack on an Android 16 emulator, before and after: after a button's
activateaction is removed, the double-tap dispatchesonAccessibilityActionwithout the change, and runsonPresswith it.