Skip to content

Commit 586f5ba

Browse files
Vineeth Kfacebook-github-bot
authored andcommitted
Added fix to use accessibility source props (#52397)
Summary: accessibilityRole is not getting the default value from sourceProps. This change will fix #52396 ## Changelog: <!-- Help reviewers and the release process by writing your own changelog entry. Fixed accessibilityRole parsing. Pick one each for the category and type tags: [GENERAL] [FIXED] - Added fix for setting the default value for accessibility props For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests Pull Request resolved: #52397 Test Plan: After this change accessibilityRole will get the default value from sourceProps. Reviewed By: joevilches Differential Revision: D77879025 Pulled By: NickGerleman fbshipit-source-id: c2fd10dd34462e2cd01488b720ba91e4f1998000
1 parent 384bd21 commit 586f5ba

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/react-native/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,11 @@ AccessibilityProps::AccessibilityProps(
224224
// it probably can, but this is a fairly rare edge-case that (1) is easy-ish
225225
// to work around here, and (2) would require very careful work to address
226226
// this case and not regress the more common cases.
227-
if (!ReactNativeFeatureFlags::enableCppPropsIteratorSetter()) {
227+
if (ReactNativeFeatureFlags::enableCppPropsIteratorSetter()) {
228+
accessibilityRole = sourceProps.accessibilityRole;
229+
role = sourceProps.role;
230+
accessibilityTraits = sourceProps.accessibilityTraits;
231+
} else {
228232
auto* accessibilityRoleValue =
229233
rawProps.at("accessibilityRole", nullptr, nullptr);
230234
auto* roleValue = rawProps.at("role", nullptr, nullptr);

0 commit comments

Comments
 (0)