Repository navigation
Rebuild the content description when accessibilityValue is removed on Android - #59540
Merged
meta-codesync[bot] merged 1 commit intoOct 29, 2026
Conversation
Visual regressionNo visual differences at ios: no capture |
javache
approved these changes
Oct 28, 2026
|
@javache has imported this pull request. If you are a Meta employee, you can view this in D128187908. |
Collaborator
|
This pull request was successfully merged by @lazerg in 25b05ac When will my fix make it into a release? | How to file a pick request? |
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, removing
accessibilityValuefrom a view leaves its content description wrong.Pressablealways passes{max, min, now, text}, so the removal reaches native as a map withouttext, andsetAccessibilityValueonly rebuilt the description whentextwas there, so the old value stayed.Viewpassesnullinstead, and that branch calledsetContentDescription(null), which dropped the label and state along with the value.setAccessibilityValuenow stores the value and always rebuilds the description from the label, state and value tags.updateViewContentDescriptionsets the description tonullwhen there is nothing left, so a view that only had a value text still ends up with no description.Fixes #59536
Changelog:
[ANDROID] [FIXED] - Removing
accessibilityValueno longer leaves its text in the content description or drops theaccessibilityLabelTest Plan:
Added three tests to
BaseViewManagerTest: a value map withouttextremoves the old text, anullvalue keeps the label, and anullvalue clears a description that only had the value text. The first two fail onmainand pass with this change../gradlew :packages:react-native:ReactAndroid:testDebugUnitTestpasses, and the Java and Kotlin format checks are clean. I didn't run the reproducer on a device.