From f3d9f2ea233304870bd4ab67d9682af6eb0ae16f Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 31 Oct 2022 04:18:44 -0700 Subject: [PATCH] Map `accessibilityRole: grid` to `UIAccessibilityTraitNone` Summary: D38121921 (https://github.com/facebook/react-native/commit/5ddb9977e662a1b41dd7203605ca8480432fc06a) added a grid accessibilityRole to Flow typings and RNTester example shared with iOS. It it forwarded on Android, but doesn't have an equivalent UIAccessibilityTrait mapping.`RNTesterSnapshotTests/testScrollViewExample` reports an error: ``` Failure: RedBox errors: ( "Error setting property 'accessibilityRole' of RCTScrollView with tag #125: Invalid UIAccessibilityTraits 'grid'. should be one of: ( adjustable, ====================== 38 lines skipped ====================== ) (NSInternalInconsistencyException) Path: Line: 0 ``` This adds the grid mapping, which I think should fix this error. Changelog: [ios][Fixed] - Map `accessibilityRole: grid` to `UIAccessibilityTraitNone` Reviewed By: christophpurrer Differential Revision: D40848904 fbshipit-source-id: 80f72bcd4e4826cc0d535693117a6c1e5fbd1d7d --- React/Views/RCTViewManager.m | 1 + 1 file changed, 1 insertion(+) diff --git a/React/Views/RCTViewManager.m b/React/Views/RCTViewManager.m index a777d5f8271736..b034ff08ac244a 100644 --- a/React/Views/RCTViewManager.m +++ b/React/Views/RCTViewManager.m @@ -64,6 +64,7 @@ @implementation RCTConvert (UIAccessibilityTraits) @"timer" : @(UIAccessibilityTraitNone), @"toolbar" : @(UIAccessibilityTraitNone), @"list" : @(UIAccessibilityTraitNone), + @"grid" : @(UIAccessibilityTraitNone), }), UIAccessibilityTraitNone, unsignedLongLongValue)