Repository navigation
Conversation
…ntentDescription On Android, EditText does not support contentDescription for accessible labels; TalkBack ignores contentDescription once text is entered and prioritizes placeholder hint text when both are present. Map accessibilityLabel on EditText views to AccessibilityNodeInfoCompat.hintText (and sync text/isShowingHintText when empty) in ReactAccessibilityDelegate, and avoid setting contentDescription on EditText in BaseViewManager and ReactAccessibilityDelegate. Fixes react#55004
jwlilly
marked this pull request as ready for review
December 5, 2026 00:23
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:
On Android,
EditTextdoes not supportcontentDescriptionas an accessible label:contentDescriptiononce text is entered into the field, soaccessibilityLabelis no longer announced when refocusing a populatedTextInput.accessibilityLabelandplaceholderare set, TalkBack prioritizes the nativehintText(placeholder) when the field is empty, overridingaccessibilityLabel.This change updates Android accessibility handling for
EditText:BaseViewManager.updateViewContentDescription, skip settingcontentDescriptiononEditText(clearing it tonull).ReactAccessibilityDelegate.onInitializeAccessibilityNodeInfo, whenhost is EditTextandR.id.accessibility_labelis non-empty, expose it viainfo.hintText, setinfo.isShowingHintText = host.text.isNullOrEmpty(), and setinfo.text = accessibilityLabelonly when empty (matching AOSPTextViewbehavior soaccessibilityLabeloverridesplaceholderin the accessibility node without altering the visual placeholder or entered/password text). Always clearinfo.contentDescription = nulland skip the fallbackgetTalkbackDescriptionassignment forEditText.ReactAccessibilityDelegate.setDelegate, attach the delegate when anEditTexthasR.id.accessibility_label.Fixes #55004
Changelog:
[ANDROID] [FIXED] - Map
accessibilityLabelon AndroidTextInputtoAccessibilityNodeInfo.hintTextinstead ofcontentDescriptionso TalkBack announces it when filled and when combined withplaceholder.Test Plan:
ReactAccessibilityDelegateTestandReactTextInputPropertyTestcovering empty and populatedEditText,accessibilityLabelcombined withplaceholder,secureTextEntry, clearingaccessibilityLabel, and ensuringcontentDescriptionis not set.ktfmt(node scripts/format-kotlin.js --dry-run) andgoogle-java-format.TextInputfields withaccessibilityLabel,placeholder, andsecureTextEntry:TextInputwithaccessibilityLabelonly: visually blank; TalkBack announcesaccessibilityLabel.TextInputwithaccessibilityLabelonly: TalkBack announces the entered value andEdit box, <accessibilityLabel>.TextInputwith bothaccessibilityLabelandplaceholder: visually rendersplaceholder; TalkBack announcesaccessibilityLabel.TextInputwith bothaccessibilityLabelandplaceholder: TalkBack announces entered value andaccessibilityLabel.TextInputwithsecureTextEntryandaccessibilityLabel: TalkBack announcesEditing, password, <N> characters, Edit box, <accessibilityLabel>.TextInputwithplaceholderonly: unchanged native behavior.issue-55004-talkback-demo.mp4