Repository navigation
Reland: [Android] Fix View accessibility payloads that Props 2.0 sends wrong or drops - #59387
Open
bartlomiejbloniarz wants to merge 1 commit into
Open
bartlomiejbloniarz wants to merge 1 commit into
bartlomiejbloniarz wants to merge 1 commit into
Conversation
…s wrong or drops Summary: Reland of #59079. It was reverted because code outside this repository that compiles against these headers still read `role` as a plain `Role` and stopped compiling. With Props 2.0 on Android (`enableExclusivePropsUpdateAndroid` and the related flags), `BaseViewManager` receives the View payload from `getDiffProps`. Some accessibility props come out wrong: - Changing one member of `accessibilityState`, such as `busy`: only that member is sent, and Java treats the map as the whole state, so a selected, disabled view becomes unselected and enabled. - A removed `accessibilityRole` or `role`: not cleared. - An explicit `role="none"`: not sent on mount, so the view falls back to `accessibilityRole`. - A removed `accessibilityValue`: sent as `{}`, so the old value stays in the content description. This PR sends `accessibilityState` in full, clears a removed role or value, and makes `role` optional so that unset and `"none"` differ. Nothing changes on Android with the flags off. iOS shares the props constructor, so a removed role is now also cleared in its C++ props. I didn't test iOS. ## Changelog: [ANDROID] [FIXED] - Fix accessibilityState, a removed accessibilityRole, role or accessibilityValue, and role="none" with Props 2.0 Differential Revision: D126922843
|
@bartlomiejbloniarz has exported this pull request. If you are a Meta employee, you can view the originating Diff in D126922843. |
Visual regressionNo visual differences at android: no capture |
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:
Reland of #59079. It was reverted because code outside this repository that compiles against these headers still read
roleas a plainRoleand stopped compiling.With Props 2.0 on Android (
enableExclusivePropsUpdateAndroidand the related flags),BaseViewManagerreceives the View payload fromgetDiffProps. Some accessibility props come out wrong:accessibilityState, such asbusy: only that member is sent, and Java treats the map as the whole state, so a selected, disabled view becomes unselected and enabled.accessibilityRoleorrole: not cleared.role="none": not sent on mount, so the view falls back toaccessibilityRole.accessibilityValue: sent as{}, so the old value stays in the content description.This PR sends
accessibilityStatein full, clears a removed role or value, and makesroleoptional so that unset and"none"differ. Nothing changes on Android with the flags off. iOS shares the props constructor, so a removed role is now also cleared in its C++ props. I didn't test iOS.Changelog:
[ANDROID] [FIXED] - Fix accessibilityState, a removed accessibilityRole, role or accessibilityValue, and role="none" with Props 2.0
Differential Revision: D126922843