Skip to content

Rebuild the content description when accessibilityValue is removed on Android - #59540

Merged
meta-codesync[bot] merged 1 commit into
react:mainfrom
lazerg:fix/issue-59536-accessibility-value-removal
Oct 29, 2026
Merged

meta-codesync[bot] merged 1 commit into
react:mainfrom
lazerg:fix/issue-59536-accessibility-value-removal

Conversation

@lazerg

@lazerg lazerg commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Summary:

On Android, removing accessibilityValue from a view leaves its content description wrong. Pressable always passes {max, min, now, text}, so the removal reaches native as a map without text, and setAccessibilityValue only rebuilt the description when text was there, so the old value stayed. View passes null instead, and that branch called setContentDescription(null), which dropped the label and state along with the value.

setAccessibilityValue now stores the value and always rebuilds the description from the label, state and value tags. updateViewContentDescription sets the description to null when 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 accessibilityValue no longer leaves its text in the content description or drops the accessibilityLabel

Test Plan:

Added three tests to BaseViewManagerTest: a value map without text removes the old text, a null value keeps the label, and a null value clears a description that only had the value text. The first two fail on main and pass with this change. ./gradlew :packages:react-native:ReactAndroid:testDebugUnitTest passes, and the Java and Kotlin format checks are clean. I didn't run the reproducer on a device.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 27, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 27, 2026
@github-actions

Copy link
Copy Markdown

Visual regression

No visual differences at 8cc94ff1487a.

ios: no capture

@meta-codesync

meta-codesync Bot commented Oct 28, 2026

Copy link
Copy Markdown

@javache has imported this pull request. If you are a Meta employee, you can view this in D128187908.

@meta-codesync
meta-codesync Bot merged commit 25b05ac into react:main Oct 29, 2026
68 of 69 checks passed
@react-native-bot

Copy link
Copy Markdown
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?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android: removing accessibilityValue leaves its text in a Pressable's content description and drops a View's label with it

3 participants