You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 074e081
Browse filesBrowse the repository at this point in the historyBrowse files
Reland: [Android] Fix View accessibility payloads that Props 2.0 sends wrong or drops (#59387)
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
Copy file name to clipboardExpand all lines: packages/react-native/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp
0 commit comments