Skip to content

Clear the previous accessibilityState on Android - #59840

Open
faciledictu wants to merge 1 commit into
react:mainfrom
faciledictu:fix/android-accessibility-state-reset
Open

faciledictu wants to merge 1 commit into
react:mainfrom
faciledictu:fix/android-accessibility-state-reset

Conversation

@faciledictu

Copy link
Copy Markdown
Contributor

Summary:

Fixes #44960.

setViewState only applies the keys of the new state, so parts of the old one stay: "mixed" after checked becomes true or false, "busy" after aria-busy is removed, and checked, selected and expanded after the whole state is removed.

It now rebuilds the content description on every change and clears what the new state no longer has.

Changelog:

[ANDROID] [FIXED] - Changing or removing accessibilityState no longer leaves the old "mixed", "busy", checked, selected or expanded state

Test Plan:

Added tests to BaseViewManagerTest; they fail on main and pass with this change. Checked on Android with https://github.com/faciledictu/rn-a11y-state-reset-repro: each view updated in place now matches the same view mounted again.

setViewState only applied the keys of the new state, so "mixed", "busy", checked, selected and expanded from an earlier state stayed after the state changed or was removed. It now rebuilds the content description on every change and clears what the new state no longer has.
@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 Nov 6, 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 Nov 6, 2026

This branch has not been deployed

No deployments
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. 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 Talkback - Checkbox accessibility state stuck with announcing "mixed" once the mixed state is introduced

1 participant