Repository navigation
fix(Touchable): pass role and the missing aria props to the host view - #59378
Open
faciledictu wants to merge 2 commits into
Open
faciledictu wants to merge 2 commits into
faciledictu wants to merge 2 commits into
Conversation
Touchable* copy a fixed list of props to their host view. role is not on any of the lists, TouchableWithoutFeedback drops aria-label and TouchableHighlight drops aria-busy, aria-checked, aria-disabled, aria-expanded and aria-selected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MzPpDcGNgvkkyMFtCXhLDi
The debug props of a view do not include role, so Fantom cannot see it on the host view of TouchableOpacity and TouchableHighlight. Keep the suite for TouchableNativeFeedback and TouchableWithoutFeedback, which pass role to their Text child. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MzPpDcGNgvkkyMFtCXhLDi
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:
Part of #59377.
Touchable*build their host view props from a fixed list, and some props they accept in their types never reach it:role: none ofTouchableOpacity,TouchableHighlight,TouchableNativeFeedback,TouchableWithoutFeedbackpasses it, so<TouchableOpacity role="button">has no role whileaccessibilityRole="button"works.TouchableWithoutFeedbackdropsaria-label.TouchableHighlightdropsaria-busy,aria-checked,aria-disabled,aria-expandedandaria-selected; the other three already map them.This change passes
rolefrom all four, mapsaria-labelinTouchableWithoutFeedback(it wins overaccessibilityLabel, as inView, and the child keeps its own label when neither is set) and maps the state props inTouchableHighlightthe same wayTouchableOpacitydoes.aria-labelledbyis left to #58173.The shared
rolePropSuitenow also runs forTouchableNativeFeedbackandTouchableWithoutFeedback; before, it ran only forText. It cannot run forTouchableOpacityandTouchableHighlight: Fantom reads the debug props of a view, andAccessibilityProps::getDebugPropsdoes not includerole, soroleon their host view is checked on a device instead (pairs G / H of the reproducer).Changelog:
[GENERAL] [FIXED] -
roleonTouchable*,aria-labelonTouchableWithoutFeedbackandaria-*state props onTouchableHighlightreach the native viewTest Plan:
yarn fantom packages/react-native/Libraries/Components/Touchable: 4 suites, 272 tests passed. (Locally withCXXFLAGS=-Wno-deprecated-literal-operator: Xcode 27.1 clang rejects theoperator "" _jsonsyntax of the bundled nlohmann_json 3.11.2 under-Werror; unrelated to this change.)yarn flow-check: no errors.yarn eslinton the changed files: no warnings.android.view.ViewGroup, I'scontent-descis the child's "×", K has nochecked; on iOS 27, G has no Button trait, I's label is "×", K's value has no "checked". After, on iOS 27: G has the Button trait, I's label is "Close I", K's value is "checkbox, checked". After, on Android 17: G isandroid.widget.Button, I'scontent-descis "Close I", K ischeckable="true" checked="true". Each matches itsaccessibility*control (H, J, L).