From 5ddb9977e662a1b41dd7203605ca8480432fc06a Mon Sep 17 00:00:00 2001 From: fabriziobertoglio1987 Date: Wed, 27 Jul 2022 07:44:59 -0700 Subject: [PATCH] Adding grid role to ViewAccessibility to fix flow errors. (#34267) Summary: Adding grid role to ViewAccessibility to fix flow errors. fixes https://github.com/facebook/react-native/issues/30861 fixes https://github.com/facebook/react-native/issues/30972 ## Changelog [General] [Fixed] - Adding grid role to ViewAccessibility to fix flow errors. Pull Request resolved: https://github.com/facebook/react-native/pull/34267 Test Plan:
flow error for missing accessibilityRole type grid

adding grid role to ScrollView

https://user-images.githubusercontent.com/24992535/180721100-62de76af-ea23-44a6-816e-f6fa39835b77.mp4

adding grid role to FlatList

https://user-images.githubusercontent.com/24992535/180724852-861c2981-0b06-4c66-a983-0017785062fe.mp4

adding grid role to SectionList

https://user-images.githubusercontent.com/24992535/180788810-d1869381-1e6b-42aa-b9b2-a84aece41326.mp4

Reviewed By: NickGerleman Differential Revision: D38121921 Pulled By: dmitryrykun fbshipit-source-id: 3bc335b3a525e75ae2e032f6a35540b3e95cd6a8 --- Libraries/Components/View/ViewAccessibility.js | 3 ++- packages/rn-tester/js/examples/ScrollView/ScrollViewExample.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/Components/View/ViewAccessibility.js b/Libraries/Components/View/ViewAccessibility.js index 51343752c55e4e..8ed64ae335aa60 100644 --- a/Libraries/Components/View/ViewAccessibility.js +++ b/Libraries/Components/View/ViewAccessibility.js @@ -43,7 +43,8 @@ export type AccessibilityRole = | 'tablist' | 'timer' | 'list' - | 'toolbar'; + | 'toolbar' + | 'grid'; // the info associated with an accessibility action export type AccessibilityActionInfo = $ReadOnly<{ diff --git a/packages/rn-tester/js/examples/ScrollView/ScrollViewExample.js b/packages/rn-tester/js/examples/ScrollView/ScrollViewExample.js index 499a077e863560..dfea4a4b07a6a6 100644 --- a/packages/rn-tester/js/examples/ScrollView/ScrollViewExample.js +++ b/packages/rn-tester/js/examples/ScrollView/ScrollViewExample.js @@ -205,6 +205,7 @@ const examples = ([ return ( { _scrollView = scrollView; }}