Skip to content

Commit d8e2fbc

Browse files
Nick Lefeverfacebook-github-bot
Nick Lefever
authored andcommitted
Fix accessibilityState serialization for props diffing of View component (#51420)
Summary: The checked and unchecked state of the accessibility state property has to be serialized as `{ "checked": true }` and `{"checked": false}`. This diff updates the serialization of the `accessibilityState` prop for the prop diffing on the View component. This fixes the e2e test selectors for radio buttons. Changelog: [Internal] Differential Revision: D74910744
1 parent ba092bf commit d8e2fbc

File tree

1 file changed

+2
-2
lines changed
  • packages/react-native/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view

1 file changed

+2
-2
lines changed

packages/react-native/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -475,10 +475,10 @@ inline static void updateAccessibilityStateProp(
475475
if (!oldState.has_value() || newState->checked != oldState->checked) {
476476
switch (newState->checked) {
477477
case AccessibilityState::Unchecked:
478-
resultState["checked"] = "unchecked";
478+
resultState["checked"] = false;
479479
break;
480480
case AccessibilityState::Checked:
481-
resultState["checked"] = "checked";
481+
resultState["checked"] = true;
482482
break;
483483
case AccessibilityState::Mixed:
484484
resultState["checked"] = "mixed";

0 commit comments

Comments
 (0)